Introduction to the Linear Programming Algorithm Q: Is this going to hurt? A: I’ll make it as painless as possible. Q: Where do we start? A: With the outline for a search algorithm: 1. 2. 3. 4. 5. 6. organize your data set up an initial solution identify search directions evaluate search directions select the best and generate a new solution repeat, until… Q: What else do we need? A: We need the word problem we were working on before. Q: Didn’t we already solve that problem? A: We solved it using a graph, but a graph is not a particularly good solution technique. Q: What’s wrong with using a graph? A: It is limited to problems having only two variables, and very few problems have only two variables. Q: Then why did you make us learn how to graph a problem? A: I am going to use the graph to illustrate all the calculations, but if don’t know how to read a graph you will have a hard time following my explanations. Here, I have copied word problem for you: You run a small pottery business, making ceramic bowls ($2.20 profit) and cups ($2.50 profit). Your only raw material is the clay you use. A cup uses 500 grams of clay, while a bowl uses 1 & 1/4 kilograms. It takes you 25 minutes to shape a bowl on your wheel and 45 minutes to shape a cup. A bowl must be “fired” for an hour and a cup for 48minutes in your kiln, which can hold 2 items at a time. You have on hand 40 kilograms of clay and you expect to put in 30 hours at the wheel next week. The kiln must be preheated every day, so it is available only 20 hours per week. Set up your production plan for next week. Q: Are we ready to start the algorithm? A: Yes. Q: How do we organize the data? A: Two ways: first by formulation and then by drawing the graph. I have copied both of these for you as Figures 1 and 2 at the top of the next page. Technically speaking, drawing the graph is not a normal part of organizing the data, but we will need it for this lecture, so I am including it here. Q: Why do we need it? A: I am going to illustrate each step of the solution process on the graph, hopefully making it easier for you to follow what I am doing. B # of bowls to make C # of cups to make Max Z = $2.20 B s.t. 1250 B 25 B 60 B B, + + + + $2.50 500 45 48 C C C C C, < < < > 40,000 1,800 2,400 0 grams of clay minutes - wheel minutes – kiln non-negativity Figure 1: Problem Formulation 90 Variable C 80 Clay 70 Kiln 60 Wheel 50 #1 40 #2 30 #3 10 #4 10 20 30 40 50 60 70 80 90 Variable B Figure 2: Graph of Problem Q: Is this the same graph we used before? A: In essence, yes, but I have removed the objective function line and added numbers to indicate the four corner points. Q: Are we ready to start? A: Not quite. We need to re-write the formulation to include some auxiliary, or supplemental, variables. Q: Why do we need these other variables? A: They make the solution process easier to understand, and serve a definite purpose when interpreting the output. Q: How do we include the new variables? A: We use them to convert the constraints from inequalities (<) to equalities without changing the meaning of the equations. To understand this, take the first constraint equation and put its components into words: 1250 B + 500 C < 40,000 grams of clay Q: How would you put into words the right-hand side of the equation: 40,000 grams of clay? A: There are 40,000 grams of clay available to use. Q: Why did you underline “available to use?” A: To set up the next question. Q: How do we use clay? A: By making bowls and cups. Q: How many bowls are we going to make? A: Ummmm… D: That’s the answer I usually get. I also get guesses, such as 1250 (mistaking the coefficient for a value) and 40,000 (confusing the constraint limit with the value), but the sad part is that the answer was given to you earlier in this lecture. Q: So, how many bowls are we going to make? A: B Q: B? A: Yes, B. The variable B is defined as the number of bowls to make. Therefore, if I want to know how many bowls I am going to make, I can use the variable to answer that question. Q: How can you do that? I thought you were looking for a number. A: I was, and a variable is a number (go back to the lecture notes on formulating if you don’t remember that). Most of you don’t believe that variables are numbers, but you need to. Q: Ok, fine, so we are making B bowls. How does that help? A: We’ll use that information to answer the next question. Q: How would you put the left-hand side of the equation into words? A: That is a little trickier, so let’s take it in pieces. Q: OK, what does the variable B stand for? A: It is the number of bowls to make. Q: Good, and what about its coefficient 1250? A: That is the number of grams used to make one bowl. Q: Good, so how do you put 1250*B into words? A: That would be the total grams of clay used to make bowls. Q: And how would you put 500*C into words? A: That is the total grams of clay used to make cups. Q: So how would you put the entire left-hand side of the equation, 1250*B + 500*C, into words? A: The total grams of clay used to … Q: Stop right there, with the word “used.” Now taking the two parts, left-hand side and right-hand side, how would you put the whole equation into words? A: Grams of clay used must be less than or equal to grams of clay available to use. Q: I said earlier we wanted to use the new variables to turn the constraints into equalities, so let’s start: How would your words read for an equality constraint? A: Grams of clay used must be equal to grams of clay available. Q: Does that statement say the same thing as the previous one? A: Not even close. The first says you don’t have to use all the clay, but the second one says you do have to use all the clay. Q: How could we change the second statement, leaving it as an equality constraint, so that it means the same thing as the first statement? A: Well, the first statement allows there to be some unused clay, so how about: grams of clay used plus grams of clay not used must be equal to grams of clay available. Q: See why I emphasized “available to use?” So, how many grams of clay will be left over – unused? A: We don’t know. That will depend on how many grams of clay are used. Q: If there is a number we want to know, but we don’t have a precise value for it, what do we use? A: A variable. D: Good. We will call this type of variable, one representing unused resources, a “slack” variable, since it represents slack (unused) resources. Q: Do we do this for all constraints? A: All < constraints, because all < constraints can be interpreted as resources (though sometimes it’s a bit of a stretch), so they can have leftover resources. Q: What do we do for a > constraint? A: Well, let’s make up a > constraint. Suppose you have a standing order (an order that is placed every week) for five items from a local shop. That means you must make at least a total of five items, and maybe more. The equation for this would be as shown at the top of the next page. B + C > 5 This time, the right-hand side of the equation is the minimum amount we need (rather than the maximum amount we can use, as with the < constraints) and the left-hand side is the amount we have to meet (or exceed) the minimum. Q: How do we insert the supplementary variable? A: Again, start by converting the equation to words, then to an equality and then make whatever changes are needed so the equality constraint means the same as the original constraint, like this: B + C > 5 is the same as units made must be greater than or equal to the minimum number ordered. which as an equality would be units made must be equal to the minimum number ordered which is wrong. To make it mean the same as the original constraint, we could write: units made minus units not ordered must be equal to the minimum numbered ordered. Q: What was different this time? A: You said “minus.” Q: So how many units will be surplus – unsold? A: We don’t know; that would be the slack variable. Q: Doesn’t a slack variable represent unused resources? A: Yes. Q: Can we use a slack variable here? A: No, because we are not dealing with a resources (maximum available) constraint; we are dealing with a contract (minimum required) constraint. Q: What kind of variable do we use for a contract constraint? A: We use a “surplus” variable, to represent the surplus amount that has been produced. D: Actually, I really don’t like the terms “slack” and “surplus” because it is too easy to get them confused. Unfortunately, nobody really much cares what I think (except, of course, my students), so we are stuck with them. Q: Can you summarize the difference between a slack variable and a surplus variable? A: A slack variable is added to the left-hand side of a <-constraint. A <-constraint is a maximum (upper) limit and the slack variable represents the how much is leftover, unused. A surplus variable is subtracted from the left-hand side of a >-constraint. A >-constraint is a minimum (lower) limit and the surplus variable represents how much we have exceeded, surpassed, the limit. Q: Are we ready to re-write the formulation? A: Yes, and it would look like: Max Z = $2.20 B s.t. 1250 B 25 B 60 B B, + $2.50 C + 0 S1 + + 500 C + S1 + 45 C + + 48 C C, S1, 0 S2 + 0 S3 S2 + S2, S3 S3 = = = > 40,000 1,800 2,400 0 grams of clay minutes - wheel minutes – kiln non-negativity Figure 3: Problem Formulation Re-written Q: Now, are we ready to start the algorithm? A: Yes, but there are two things I would like you to notice. One is that the slack variables are listed in the non-negativity constraints. The other is that the slack variables are listed in the objective with a profit of zero. Q: Why do the slack variables have a profit of zero? A: They represent leftover resources, and resources (raw materials) left sitting in your warehouse contribute nothing to total profit. Q: Should the slack variables have a negative profit, showing the cost of storing idle inventory? A: You can do that, or you can argue that idle inventory is part of overhead, which is a fixed cost and has no part of decision making. Most of the time we simply leave the profit as zero. Q: What do we do next in the algorithm? A: We’ve organized the data, so we need to come up with an initial solution. Q: Do we use the Northwest Corner method, as we did in the Transportation Algorithm? A: No. Q: Do we get to choose one of a bunch of different starting solutions? A: No, we will always use the same starting solution. Q: Is that because it is the best starting solution? A: Not the best, necessarily, but certainly the most convenient, and is it is very easy to calculate. Q: What is the initial solution? A: The origin. Q: You mean where the axes cross? A: Right, where B and C are both equal to zero. Q: Why do we start there? A: Well, one answer is because it is literally correct. We are planning how much to make and right now we haven’t made anything. The more important reason, though, is that the origin is a corner point. Q: What’s a corner point? A: You may remember from the “Introduction to Graphing” lecture notes that a corner point is where two (or more) constraints intersect. Q: Isn’t the optimal solution always found on a corner point? A: Yes, it is, and that’s another part of the reason we start at the origin. Q: So, what’s the whole explanation of why we start at the origin? A: Begin with the fact that the optimal solution will always be at a corner point. It is also true that it easy (mathematically) to move from a corner point to another corner point, but very hard to move from a non-corner point to a corner point. That tells us that, if at all possible, we would like to start on a corner point. That brings up a new problem, though. If corner points are defined by the constraints, and the constraints are different for every problem, then the corner points are different for every problem. Q: Couldn’t we just pick any two constraints and find their intersection? A: You could, but then you wouldn’t know whether to search up or down (further from the origin or closer to it). The origin has two great properties: it is always a corner point (intersection of constraint lines) and … Q: Which two constraints intersect at the origin? A: The non-negativity constraints, which are a part of every problem. …and it is the lowest point in the first quadrant, where all our solution will lie, so we know to search up (further from the origin) for the optimal solution. Q: OK, so the origin is always our initial solution. What do we do next? A: Identify and evaluate search directions. Q: What do we use for the search directions? A: Something similar to what we used in the Transportation algorithm. Q: Something similar to an empty route? A: Yes. We looked at the empty routes to see if bringing them into use would save us any money. What we need is something that we can move from a value of zero to a positive value and in doing so, improve the objective value. Q: Don’t some of the variables have a value of zero? A: Yes, the two decision variables, B and C, have values of zero because the current solution point is the origin. At the origin, all decision variables have a value of zero. Q: You say the decision variables have a value of zero. Does that include the slack variables? A: No, slack variables are not decision variables. Q: If the slack variables aren’t decision variables, what are they? A: You might call them dependent variables. You may remember independent and dependent variables from statistics. Independent variables can take on any value you choose, but the value of a dependent variable must be calculated from the value of the independent variables. That is how it works for the slack (and surplus, if we had any) variables. You plug in the chosen values for B and C, then calculate the values for the slack variables using the constraint equations in Figure 3. Doing that, we get the values listed in Table 1. The graph in Figure 4, next to table 1, illustrates the current solution. C Variable List Bowls Cups Slack – Clay Slack – Wheel Slack - Kiln Origin Reduced Value Cost 0 2.2 0 2.5 40,000 0 1,800 0 2,400 0 Table 1: Solution at Origin Clay Kiln #2 #1 Wheel #3 #4 O B Figure 4: Solution at Origin Q: What do the arrows from the origin to the constraint lines represent? A: They are a way of depicting the slack variables on the graph. Q: Can’t you measure the slack variables along the axes, like the decision variables? A: No, the axes are specifically for measuring the decision variables, which is why they are labeled with the decision variable names. The slack variables are measured as the distance from the current solution point to the constraint lines. The length of the lines may seem too short, but they are measured on an entirely different scale than the axes. We can actually make a general statement that any time the solution point is below (down and left of) a <-constraint the slack variable for that constraint has a positive value. Q: What does the column labeled “Reduced Cost” tell us? A: That is the result of the evaluation of the search directions, just like the net change in cost we calculated in the Transportation algorithm using the +1/-1 steps. Q: Why are they called reduced costs? A: Well, the “costs” part of the name is historical. When the first linear programming problems were set up, they all dealt with cost minimization and everyone got in the habit of referring to everything in terms of cost. When profit maximization functions became more prevalent, the name just hung on. Q: But why “reduced?” A: Think for a minute of the Transportation algorithm. We wanted to know the cost of using an empty route. That empty route had a cost/unit (say $15, just as an example) associated with it, and adding a unit to that route would assuredly have cost us that $15. There were other changes involved, though, some of which increased costs (+1 routes) and some of which decreased costs (the -1 routes). We added up all the cost changes caused by shipping one unit on that empty route and calculated a net change in cost. When we got the result we hoped, for the cost of using the empty route was changed, lowered. Another word for lowered is “reduced,” thus reduced costs. Q: Are the calculations for the reduced costs the same +1/-1 pattern as in the transportation algorithm? A: Unfortunately, no. In the transportation algorithm when you add one unit to a route, you take away exactly one unit from another route – the tradeoff is one-for-one. In linear programming, a change to a variable with a value of zero affect the some of the other variables (decision variables and slack/surplus variables), but the amount of the change is based on the coefficients of the variable in the constraints. These are the calculations I don’t think you need to learn. I will illustrate them once, now, and a second time, but from then on I will simply present the result (the reduced cost) without showing the calculations. Q: How do we get started? A: I have copied the formulation of the problem here as Figure 5: Max Z = $2.20 B s.t. 1250 B 25 B 60 B B, + $2.50 C + 0 S1 + + 500 C + S1 + 45 C + + 48 C C, S1, 0 S2 + 0 S3 S2 + S2, S3 S3 = = = > 40,000 1,800 2,400 0 grams of clay minutes - wheel minutes – kiln non-negativity Figure 5: Problem Formulation for Reduced Cost Calculations And we need to select a variable with a value of zero to work on. Q: Does it matter which variable we select? A: No, because just as with the empty routes, we will eventually try them all. Q: Can we start with variable B, then? A: Sure. Now, B is currently equal to zero and we want to give it a value of 1. We have to figure out which of the other variables are affected by that change. Q: Will C be affected? A: No. C currently has a value of zero also, and you may remember that, in transportation, we used only one empty route at a time. In the same way, in linear programming, we make changes to only one zero-valued variable at a time. This time, we can show (if you are really interested, come by my office) that there will be no interaction between the two zero-valued variables, but it is enough for you to simply know that we deal with one zero-valued variable at a time. So, C will keep its value of zero when B takes on a value of one. Q: What about the slack variables? A: Well, those represent unused resources, and making one bowl (B takes on a value of 1) will definitely use up some resources, so we would expect the slack variables to change. Q: How much do they change? A: Let’s look at the constraints. I have copied the constraints here (Figure 6), but have substituted the values of 1 and 0 for B and C, respectively: 1250 (1) + 25 (1) + 60 (1) + 500 (0)+ S1 = 40,000 grams of clay 45 (0) + S2 = 1,800 minutes - wheel 48 (0) + S3 = 2,400 minutes – kiln Figure 6: Calculating the Effects of a +1 Change to B Remember (from Table 1, above) that the values of the slack variables at the origin (before taking letting B take on a value of 1) were 40,000, 1,800 and 2,400, respectively. Working out the equations in Figure 6 leaves us with the new values of 38,750 for Slack – Clay (S1), 1,775 for Slack – Wheel (S2) and 2,340 for Slack – Kiln (S3). Unsurprisingly, the values of the leftover resources went down by the amounts that the bowl used – the coefficients of the B variable. Q: What does this tell us? A: By itself, nothing. This is the equivalent of the +1/-1 steps in the transportation algorithm, and then – and now – there was another step: converting the +/1 changes to changes in profits. As before, we do that by multiplying the changes in the variable values by the profit coefficients from the objective function, as shown in Table 2. I’ve also shown the calculation for C: Variable B C S1 S2 S3 Change +1 0 -1,250 -25 -60 Profit/Unit Variable Change cost 2.20 +2.20 B 0 2.50 0 C +1 0 0 S1 -500 0 0 S2 -45 0 0 S3 -48 Reduced +2.20 Cost Table 2: Reduced Cost Calculations for B and C Profit/Unit 2.20 2.50 0 0 0 Reduced Cost cost 0 +2.50 0 0 0 +2.50 Q: What have we learned? A: Just as we did with the transportation algorithm, we select the search direction that has the best effect on our objective. In this case, our objective is to maximize profits, so we pick the reduced cost that is the highest positive number, in this example, 2.50. Q: What does selecting 2.50 tell us? A: It tells us that, starting off, it is better to increase the value of the variable C (to make cups) than to increase the value of the variable B (to make bowls). Q: How does that help us? A: Well, to start, I have copied Table 1 and Figure 4 to the top of the next page. There, I have shown what we have learned two ways: I have highlighted the 2.5 as the best number in the Reduced Cost column, and I have drawn in an arrow, starting at the origin and pointing up, showing how the solution point will move on the graph. Q: What else do we need to know? A: In the transportation algorithm, the next step was to determine the number of units to put in the empty route. In linear programming, we need to find the new value for the variable we have chosen, C. C Variable List Bowls Cups Slack – Clay Slack – Wheel Slack - Kiln Origin Reduced Value Cost 0 2.2 0 2.5 40,000 0 1,800 0 2,400 0 Table 3:Cups Reduced Cost is Best Clay Kiln #1 #2 Wheel #3 #4 O Figure 7: Making Cups B Q: How do we find the new value for the variable C? A: Well, we want the new value to be as high as possible while staying within the solution space. Since C is going to take on a positive value and B is going to stay at a value of zero, we are going to move straight up along the C-axis. Q: Where do we stop when moving up the C-axis? A: When we reach the first corner point. Q: Isn’t that rather easy – corner point #1? A: It is if you can see the graph, but a computer can’t see the graph. It has to calculate the values of all possible corner points and pick one. Q: How does it do that? A: Well, the slack variables, to a certain extent, represent the constraints. The values of the slack variables at the current solution (the origin, remember that we haven’t calculated the new solution yet) are shown in Table 3, above, tell us how much of each resource (constraint) is currently unused. The coefficients for C from the constraints (the “Change” column in Table 2) tell us how much one unit of C will consume of each resource. Dividing the amount available by the consumption rate tells us the value for C that will use up each resource (this is another calculation you will never have to do for me). Thus, for the Clay constraint: 40,000 g of clay available ÷ 500 g of clay per cup = 80 cups to use up all the clay. In the same way, for the Wheel and Kiln constraints: 1,800 min on the wheel available ÷ 45 min on the wheel per cup = 40 cups to use up all the wheel time 2,400 min in the kiln available ÷ 48 min in the kiln per cup = 50 cups to use up all the kiln time. Q: Does this help? A: Certainly. By an amazing non-coincidence, those numbers happen to be the C-axis intercepts of the three constraint lines. By picking the smallest number, the algorithm picks the closest corner point. Q: Wouldn’t we want to pick the largest number, to make more money? A: Yes, but then we would move out of the solution space. After we make 40 cups, there is no time left on the potter’s wheel. Even though we have clay and kiln time left, we can’t use it to make more cups. This is exactly the same logic as we used when picking the number of units to put into an empty cell in the transportation algorithm. We looked at the units available in routes that were decreasing (though they were decreasing at the same rate, unlike here) and picked the one that emptied out first. Q: Where does this get us? A: To Table 4 and Figure 8, shown next: C Clay Kiln Variable List Bowls Cups Slack – Clay Slack – Wheel Slack - Kiln Origin Reduced Value Cost 0 2.2 0 2.5 40,000 0 1,800 0 2,400 0 Corner Point #1 Reduced Value Cost 0 40 20,000 0 480 Table 4: Solution at Corner Point #1 #2 #1 Wheel #3 #4 O Figure 8: Corner Point #1 Q: Where did the values for the slack variables come from? A: We took the values at the origin and subtracted off the amounts of each resource used to make 40 cups, that is 500*40 for clay, 45*40 for the potter’s wheel, and 48*40 for the kiln. Q: What next? A: This is an algorithm, so we repeat everything. We have a solution, and we have search directions (the zero-valued variables) of B and S2. We need to calculate the reduced costs for those two variables. Q: Why don’t we calculate the reduced costs for all the variables? A: Reduced cost is a calculation that tells us the effect on the objective for a 1-unit increase in a variable’s value. If a variable has a positive value, that value is always the highest possible value for that variable. Thus, there cannot be a 1-unit increase in the variable’s value and so there is no reduced cost to calculate. By tradition (and for a very good mathematical reason that you don’t need to know), we always assign a basic variable a reduced cost of zero. D: This can get confusing. Variables with a VALUE of zero have a non-zero REDUCED COST, while variable with a non-zero VALUE have a REDUCED COST of zero. You just have to learn it. Q: Are you going to make us look at the calculations, or just give the results to us? A: Once again, I am going to make you look at the calculations, but this will be the last time. The numbers are shown in Table 5 at the top of the next page. This time the calculations are more interesting, because there is a negative effect on a decision variable, and you can see, a little better, why the calculation is called the reduced cost. B Variable B C S1 S2 S3 Change +1 -0.556 -972.222 0 -33.333 Profit/Unit Variable Change cost 2.20 +2.20 B 0 2.50 -1.39 C -.022 0 0 S1 +11.111 0 0 S2 +1 0 0 S3 +1.0667 Reduced +0.81 Cost Table 5: Reduced Cost Calculations for B and S2 Profit/Unit 2.20 2.50 0 0 0 Reduced Cost cost 0 -0.06 0 0 0 -0.06 Q: Where did those numbers come from? A: Ugly, aren’t they? Aren’t you glad you’ll never have to calculate them? I’ll explain them in a minute. Q: Where should we be looking? A: At the Cost column. Making one unit of B brings in $2.20 in profits, which makes sense. But you have to give up a fraction of variable C (25/45 th, to be precise) and that means giving up some of the profit we made on C as well, $1.39. Q: Wait a minute. Why did we have to give up some of C, and where did 25/45ths come from? A: We had to give up some C because B needs time on the potter’s wheel, and all the time on the potter’s wheel has been devoted to making 40 of C. The only way to create the needed time on the potter’s wheel is to make fewer of C, thus freeing up time on the wheel. Q: Doesn’t that mean we would make one fewer of C, not 25/45 ths? A: No, giving up one of C to make one of B implies a one-to-one tradeoff, but that isn’t what we have. We aren’t trading off units of product as much as we are trading off time on the wheel. Now making one of B requires 25 minutes on the wheel. We get those 25 minutes by decreasing C production just enough to free up 25 minutes. Making one of C, though, takes 45 minutes, so we don’t have to give up a whole unit of C, only enough to free up 25 minutes, which is slightly more than a half, specifically, 25/45ths, or 0.555 repeating, rounded to 0.556. You can see this same thing in Table 6 and Figure 9, shown below. Figure 9 has an arrow coming out of Corner Point #1, and pointing along the constraint line to the right. We have to stay on or within the solution space, so we are forced to decrease, slightly, the amount of C to make some B. The reduced cost calculation, by coming out to be a positive number, tells us this tradeoff is worthwhile. C Variable List Bowls Cups Slack – Clay Slack – Wheel Slack – Kiln Origin Reduced Value Cost 0 2.2 0 2.5 40,000 0 1,800 0 2,400 0 Corner Point #1 Reduced Value Cost 0 0.81 40 0 20,000 0 0 -0.06 480 0 Kiln #1 #2 Wheel #3 O Table 6: Reduced Costs for Corner Point #1 Solution Clay #4 Figure 9: From CP #1 B Q: If we aren’t moving along an axis, how can we calculate intercepts to find the next corner point? A: The algorithm treats the “Wheel” constraint line as if it were an axis. Most of the ugly calculations that go with the linear programming algorithm work to take care of this. For our purposes, you can think that the algorithm calculates the intercepts for the other constraints with the wheel constraint, and picks the lowest number. That equates to the first corner point we come to, Corner Point #2. This is shown in Table 7 and Figure 10: C Origin Variable List Bowls Cups Slack – Clay Slack – Wheel Slack – Kiln Corner Point #1 Value R/C Value R/C Corner Point #2 R/C Value 0 0 40,000 1,800 2,400 2.2 2.5 0 0 0 0 40 20,000 0 480 0.81 0 0 -0.06 0 14.4 32.0 6,000 0 0 Clay Kiln #1 #2 Wheel #3 #4 O B Table 7: Solution for Corner Point #2 Figure 10: Corner Point #2 Q: Isn’t that the optimal solution? A: We know that from our earlier work, but the algorithm doesn’t know that yet. Do you remember how, in the transportation algorithm, we had the best solution in the fourth iteration, but we had to check the empty routes to be sure we had found the best solution? Well, we have to check the zero-valued variables again. Q: What are the zero-valued variables this time? A: We know it can’t be B or C, because our solution point is in the middle of the first quadrant, so both of those variables must have a positive value. We see that our solution point, #2, is on two constraint lines, Kiln and Wheel. That must mean that all of those resources are used up, or that the slack variables, S2 and S3, are zero. Q: Could you explain again how you knew, from the graph, that S2 and S3 had to be zero? A: Remember up in Figure 4, when I used arrows to indicate the values of the slack variables? The length of those arrows, measured in the proper units, tells the value of the slack variables. When a solution point is on a constraint line, then the length of the arrow from the solution point to the line must be zero, and that is the value of the slack variable. To say it another way, if a solution point is below a constraint line, then there is positive slack for that constraint. If the solution point is on a constraint line, then the value of slack must be zero. F the solution point is ABOVE a constraint line, then you had better be talking about a >-constraint, and the surplus variable takes on a positive value. Q: If we do the reduced cost calculations for S2 and S3, what will we find? A: Table 8, on the next page, shows the actual values (but not the calculations, we are through with those, thank goodness). The first thing you should notice is that all the reduced costs are negative. This means that there is no way to improve our objective (which is to maximize profits) anymore. Therefore, we are finished. Origin Variable List Bowls Cups Slack – Clay Slack – Wheel Slack – Kiln Corner Point #1 Corner Point #2 Value Value R/C 0 2.2 0 14.4 0.81 0 40 0 32.0 2.5 40,000 0 20,000 0 6,000 1,800 0 0 -0.06 0 2,400 0 480 0 0 Table 8:Reduced Costs for Corner Point #2 0 0 0 -0.03 -0.02 Value R/C R/C Q: Doesn’t that sound a lot like the end of the transportation algorithm? A: It should, except then we were working with costs, so the sign of no further improvements was that all the net changes in cost were positive. Here we are maximizing profits, so if every change will decrease our profits, we look no further. Q: Do we really need to know all this? A: Yes, if for no other reason than it will be on the final. However, I will use the process of the algorithm in the next set of lecture notes (LP Special Cases) to help you understand some odd things that can happen when working with an algorithm and what you need to be concerned about. Q: Should we start reading those lecture notes? A: First, pull out the notes on LP Definitions. You will find a few terms in there that I will be using and explaining in the next set of notes, so you might want to learn those first.
© Copyright 2026 Paperzz