# This is Solution of Scheduling Programs on Goods Manufactured

Production scheduling programs must be adjusted to various constraints, for example: production machine capacity, warehouse capacity, availability of raw materials, cost of goods, and others.

I tried to give an example of a solution to the cost of goods sold constraint using linear programming. I tried to determine the cost of goods manufactured (COGS) constraint because the production machine and warehouse constraints are already included in the COGS component. In addition, companies that dare to compete are companies that prioritize efficiency, so they are usually sensitive to increases in COGS without having to sacrifice consumer demand.

## Scheduling programs with linear programming

There is a demand for goods for the next 6 months in the company after XnotY as follows:

The COGS in this example is assumed to be different every month. The assumptions we use are as follows (company conditions after X, not Y):

Production machine capacity is 1400 cartons per month.
Storage cost is Rp 20/month/carton.
Goods have an expiration period of 1 year, so demand can be fulfilled in the same month or the previous month.
Warehouse capacity should not exceed 2000 cartons.
The company wants the initial stock to always be above or equal to 200 cartons to anticipate additional demand.
Initial stock was 200 cartons, and the expected end stock in month six is also 200 cartons.

Leave Excel to make a table and create a formula for initial stock + production minus demand = final stock. Let’s think of linear programming because LP (linear programming) is a tool to solve problems like this. Although the results obtained later are not necessarily the best choice for management, the LP results are definitely the optimum conditions, depending on whether we make the mathematical equations correctly.

So let’s get it done!
The concept of this exercise is production cost minimization. So we will minimize the cost of production and warehouse to meet production;

The objective or goal that we want to use is

Min

200Q1 + 250Q2 + 300Q3 + 300Q4 + 350Q5 + 300Q6 + 20S1 + 20S2 + 20S3 + 20S4 + 20S5 + 20S6

Description: Q1: first production; Q2: second month production; Q3: third month production; Q4: fourth-month production; Q5: fifth-month production; Q6: sixth-month production S1: month one end balance; S2: month two end balance; S3: month three end balance; S4: month four end balance; S5: month five end balance; S6: month six end balance

After creating the objective, we start to describe the constraints of linear programming.

The production capacity cannot exceed 800. Therefore, the values Q11400, Q21400, Q31400, Q41400, Q51400, and Q61400
Demand can be met by previous production. We make this equation for each month. Which becomes:
200 + Q1 = 1200 + S1 (for the first month) >> Q1 + S1 = 1000
S1 + Q2 = 800 + S2 (for the second month) >> S1 + Q2 + S2 = 800
S2 + Q3 = 1500 + S3 (for the third month) >> S2 + Q3 + S3 = 1500
S3 + Q4 = 1500 + S4 (for the fourth month) >> S3 + Q4 + S4 = 1500
S4 + Q5 = 2000 + S5 (for the fifth month) >> S4 + Q5 + S5 = 2000
S5 + Q6 = 1200 + S6 (for the sixth month) >> S5 + Q6 + S6 = 1200
Warehouse capacity is 2000, so it becomes S1 < 2000, S2 < 2000, S3 < 2000, S4 < 2000, S5 <  2000, and S6 <  2000. Starting stock is always above 200: S1>200, S2>200, S3>200, S4>200, S5>200, and S6>200.
The end stock is expected to be 200. >> S6=200
So the constraints that we get are as follows:
Q1<1400
Q2 <1400
Q3 <1400
Q4<1400
Q5<1400
Q6<1400
Q1 – S1 = 1000
S1 + Q2 – S2 = 800
S2 + Q3 – S3 = 1500
S3 + Q4 – S4 = 1500
S4 + Q5 – S5 = 2000
S5 + Q6 – S6 = 1200
S1 <2000
S2<2000
S3<2000
S4<2000
S5<2000
S6<2000 S1>200
S2>200
S3>200
S4>200
S5>200
S6>200
s6=200
S6=200

Let’s run Lindo by writing the following command in the console:

Min
200Q1 + 250Q2 + 300Q3 + 300Q4 + 350Q5 + 300Q6 + 20S1 + 20S2 + 20S3 + 20S4 + 20S5 + 20S6
Subject to
Q1<1400
Q2 <1400
Q3 <1400
Q4<1400
Q5<1400
Q6<1400
Q1 – S1 = 1000
S1 + Q2 – S2 = 800
S2 + Q3 – S3 = 1500
S3 + Q4 – S4 = 1500
S4 + Q5 – S5 = 2000
S5 + Q6 – S6 = 1200
S1 <2000
S2<2000
S3<2000
S4<2000
S5<2000
S6<2000 S1>200
S2>200
S3>200
S4>200
S5>200
S6>200
s6=200
End

The inputs are as follows:

And we will get the following result:

It is not surprising if LP advises you to maximize production in the early months because in those months the COGS is low, especially with the warehouse receipt value assumed to be the same every month.

In the lindo output result, the total cost to be borne by the company AfterXnotY is Rp. 2,390,000 by producing 1400 cartons from month one to month five and 1200 cartons in month six.

Now let’s open Excel, use the initial balance addition and subtraction formula, and place the LP results in their respective positions. The following results were obtained:

The balance value is exactly what LP predicted.

Let’s assume the warehouse cost is not flat, but different every month as follows:

We change the linear programming objective without changing the constraints so that it becomes

Min

200Q1 + 250Q2 + 300Q3 + 300Q4 + 350Q5 + 300Q6 + 45S1 + 40S2 + 35S3 + 30S4 + 25S5 + 20S6

And the results are as follows: