LP Special Cases

advertisement
LP Special Cases
Q: What are special cases of LP?
A: They are oddities that occur in the normal operation of the algorithm. Two are opportunities and two
are serious problems.
Q: Why do we need to know about them?
A: If you are using LP and one pops up, but you don’t know how to interpret it, then you have either
missed an opportunity or stumbled into a serious problem and are unaware of that. Also, most
algorithms have something akin to these special cases, so if you understand these, then you should be
forewarned to look for and try to understand the new ones.
Q: Do we have to?
A: Yes you have to, because your sadistic professor is likely to put one or more of these special cases on
your final exam.
Q: Where do we start?
A: With the following graph:
Y
A
1
B
2
3
O
C
X
Figure 1: Degenerate Special Case Graph
Q: What do you see in Figure 1?
A: A graph of two decision variables (X and Y) and three less-than-or-equal-to constraints (numbered 1,
2, and 3). The corner points of the solution space are labeled O, A, B, and C. The graph appears to be
for a maximization problem.
Q: Do you notice anything unusual about the graph?
A: At corner point B, there are three constraints intersecting at one point. Usually, a corner point has only
two constraints intersecting at one point.
Q: Is this a problem?
A: No, this is one of the opportunities.
Q: Since we can’t draw a graph of most business-world problems (see, we did read the notes) how are we
going to identify this opportunity?
A: You have to learn to identify it from an LP printout.
Q: Is this where we have to use all those definitions you gave us, of basic variables and slack variables,
and reduced costs and all that other stuff?
A: Yes, so if you haven’t learned those definitions yet, pull out that sheet and keep it nearby.
Q: Are you going to tell us how to identify the special case from an LP printout?
A: You know it can’t be that easy. I’m going to use the opportunity to force you to understand how the
LP algorithm works. In doing that, you will also learn why these special cases occur and what you can
do about them.
Q: So where do we start?
A: Where the LP algorithm always starts – at the origin (maybe you didn’t read those other notes as
closely as you should have).
Q: What is the list of variables for this problem?
A: You haven’t given us a formulation for the problem on the graph, so we don’t know.
Q: You should be able to get the variables from the graph, so look there and tell me, what is the list of
variables for this problem?
A: X and Y.
Q: Good, and since we are starting at the origin, what are the values of X and Y?
A: They both have a value of zero.
D: Good. Let’s set up our variables in a table as we did before:
Origin
Variable
Value
Red. Cost
X
0
Y
0
Table 1: First Solution
Q: How many basic variables do we have at this corner point?
A: Two, X and Y.
Q: Wrong. What is the definition of a basic variable?
A: A variable with a positive value.
Q: Do X and Y have positive values?
A: No, they have values of zero.
Q: So what kind of variables are they?
A: They are non-basic variables.
Q: So, how many basic variables do we have?
A: We don’t have any basic variables.
Q: Good. How many basic variables should we have (this is one of your definitions)?
A: We should have one basic variable for each constraint in the problem (excluding the non-negativity
constraints) – yes, we did read the notes.
Q: Do we have a problem?
A: No, we simply have failed to list all the variables.
Q: Since we listed one variable for each axis of the graph, which variables did we miss?
A: The ones that relate to the constraints.
Q: How many constraints do we have?
A: Three.
Q: So how many (and what kind of) variables are we missing?
A: Three slack variables (you must have read those other notes).
Q: Good, and what are their values (so we can add them to our table)?
A: We don’t know.
Q: You don’t know?
A: No, because slack variables get their values from the values of the decision variables (the slack
variables are dependent variables) and for that we need the constraint equations, which we don’t have.
Q: That’s true, we can’t give them specific values, but can you tell me anything about the values of the
slack variables?
A: From the graph, we can tell that they all have positive values.
Q: How do you know that?
A: One of our definitions says that if a solution point is below a < - constraint line then the slack variable
for that constraint has a positive value. Since the origin is below all three constraint lines, we know
that all three slack variables have positive values.
Q: So what kind of variables does that make them?
A: They are basic slack variable.
Q: How many basic variables were we supposed to have?
A: Three, the same as the number of constraints.
D: What a coincidence! Let’s add them to our table:
Origin
Variable
Value
Red. Cost
X
0
Y
0
Sl1
+
Sl2
+
Sl3
+
Table 2: First Solution with All Variables
Q: What do we do next?
A: We have to figure out the reduced cost for each non-basic variable.
Q: That’s X and Y, right?
A: Right.
Q: I thought we weren’t going to calculate any more reduced costs?
A: We aren’t – I’m simply going to make them up.
D: A funny thing would happen in my lectures when I reached this point. I would do my best to get
everyone’s attention, ask, “Is everyone listening to me?,” and repeat that several times – I am simply
making up the reduced cost values. Inevitably, within ten minutes, someone would raise their hand to
ask me where the reduced costs came from. Sometimes you just can’t win.
Q: So, what values are you going to make up?
A: The values I will make up will fit the problem as illustrated in the graph, and the relative values will be
correct, as will the sign (positive or negative), but specific values are not relevant to what I am
covering, so I’m not worried about that. Look at Table 3:
Origin
Variable
Value
Red. Cost
X
0
+2
Y
0
+5
Sl1
+
0
Sl2
+
0
Sl3
+
0
Table 3: First Solution - Complete
Q: Where did those reduced cost values come from (I couldn’t resist)?
A: I made them up, except, as I am sure you remember from your definitions – since you read them so
carefully - the reduced cost of a basic variable (positive value) is always zero, so those were easy to
make up.
Q: What does this tell us?
A: The reduced cost tells us the effect on the objective for a change in a variable’s value, so we learn that
we can improve our profit (currently zero) the most by making the variable Y into a basic variable.
This is illustrated in Figure 2 at the top of the next page.
Q: If we make Y a basic variable, won’t that give us four basic variables, when we are supposed to have
only three (one for each constraint)?
A: Yes and no (don’t you just love answers like that?). Yes, if we gave Y some minimal value, but we
will give Y as great a value as we can, so some currently basic variable
Y
A
1
B
2
3
C
O
X
Figure 2: Y as the Entering Variable
will become non-basic. The variable that becomes basic is called the “entering” variable (it enters the
collection of basic variables) and the variable that becomes non-basic is called the (are you ready for
this?) “exiting” variable (it exits the collection of basic variables). Aren’t we management scientists
clever at naming things?
Q: Which variable is the exiting variable?
A: As the value of Y increases, the solution point moves up the Y-axis until it hits corner point A, where it
has to stop.
Q: Why do we have to stop at corner point A?
A: If we continued to move in the same direction – straight up – we would move outside the solution
space, which we don’t want to do, so we stop at the first corner point we hit.
Q: How does this help us figure out which variable will be the exiting variable?
A: Let me answer that by asking:
Q: How do you determine the value of a slack variable from a graph?
A: You look at the distance from the current solution point to the constraint line.
Q: At corner point A, how far are you below constraint line #1?
A: Umm … isn’t corner point A on constraint line #1?
Q: Yes, so how far below the line are we?
A: We aren’t below it, we are on it.
Q: Right, so how far below it are we?
A: We are zero distance below the line.
Q: Exactly, and how do you tell the value of a slack variable from a graph?
A: You measure the distance the current solution point is below the constraint line.
Q: So what it the value of the slack variable for constraint line #1?
A: It must be zero.
Q: Right. Is that basic or non-basic?
A: It is non-basic, since a non-basic variable is defined as having a value of zero.
Q: So a non-basic variable (Y) became basic (entered) and the basic variable (Sl1) became non-basic
(exited). Does that complete one iteration of the algorithm?
A: Yes it does. Table 4 and Figure 3 reflect the current solution.
Q: How many basic variables do we have?
A: Three, just as we should.
Y
Variable
X
Y
Sl1
Sl2
Sl3
Origin
Point A
Red.
Red.
Value
Value
Cost
Cost
0
+2
0
+1
0
+5
+
0
+
0
0
-0.5
+
0
+
0
+
0
+
0
Table 4: Second Solution
A
1
B
2
3
O
C
X
Figure 3: Point A Solution
Q: Notice that I have put in the reduced costs for the non-basic variables at point A. Is the current
solution optimal?
A: No, because the reduced costs are not all negative or zero. One of the definitions tells us that a
maximization problem is optimal when the reduced costs are all negative or zero.
Q: Which variable is the new entering variable?
A: X, because it still has a positive reduced cost.
Q: What does that mean on the graph?
A: We will move along constraint line 1 to corner point B. Variable X will increase in value and variable
Y will decrease in value a little. We know this trade-off is worthwhile because the reduced cost is
positive.
Q: How will we identify the exiting variable?
A: Look at corner point B and see which constraint lines we are one at that point
Q: So, which constraint lines are we on at corner point B?
A: We are obviously still on constraint line #1, but we are also on constraint lines #2 and #3, since all
three intersect at that one corner point.
Q: What does that tell you about the values of the slack variables?
A: All three slack variables (Sl1, Sl2, and SL3) will have a value of zero. This is shown in Table 5:
Variable
X
Y
Sl1
Sl2
Sl3
Origin
Point A
Red.
Red.
Value
Value
Cost
Cost
0
+2
0
+1
0
+5
40
0
+
0
0
-0.5
+
0
+
0
+
0
+
0
Table 5: Optimal Solution
Point B
Red.
Value
Cost
+
0
+
0
0
-0.2
0
-0.7
0
0
Q: How many basic variables do you have?
A: Only two.
D: That is what makes this a “degenerate” solution. In this setting degenerate means simply that an
algorithm breaks down (it does not mean the same thing as when you parents use that word to refer to
you). Expecting three basic variables, because there are three constraints, and finding only two, the
algorithm would simply stop at this point, unless it had a trick for getting around this problem. The
trick is simply to treat one of the non-basic variables as if it were basic. This creates the problem that a
variable labeled as basic actually has a value of zero, but the computer can live with that.
Q: What caused this to happen?
A: Constraint line #3 is redundant.
Q: What does that mean?
A: It means that if constraint line #3 were removed form the graph, the shape of the solution space would
be unchanged. A redundant constraint line is usually far removed from the solution space, not
touching it at all. In this case, it was tangent to the solution space, which caused all the trouble.
Q: Could we get rid of this problem simply by removing the constraint?
A: You could, but only because we have a graph to look at. Without a graph, it is very difficult to identify
a redundant constraint, so we mostly don’t bother to try.
Q: So how do we identify this special case from an LP printout?
A: Look for a variable that is labeled as “basic” (most printouts do this), but has a value of zero (contrary
to the definition, which is that basic variables have positive values).
Q: You called this an opportunity. Why?
A: Opportunity might be too strong a word, but it certainly is nothing to worry about. Think about the
normal result for a problem like this. If only two (out of three) constraints intersected at each corner
point, then any solution would have one of the three constraints with leftover units. With a degenerate
solution, the third constraint is also fully used, which from a business point-of-view would have to be
considered a good thing, and thus an opportunity. Don’t brag to your boss about it, though. Unless
your company operates on a just-in-time basis, this was simply luck, and you may not be able to make
it happen again.
Q: Does that finish the first special case?
A: Yes it does. The next one is even more of an opportunity, if you have the wit to take advantage of it.
Also, the next presentation will go faster, because I am going to assume that you have grasped the
definitions that I drew out so laboriously in the first presentation. I will only go into detail for any
newly defined terms.
Q: So what does the graph look like for the next special case?
A: It looks like this:
Y
A
1
B
2
C
3
D
O
X
Figure 4: Alternate Special Case
Q: What do you see in the graph in Figure 4?
A: Again, a maximization problem with two decision variables (X and Y) and three < constraints. The
constraints are numbered, the corner points of the solution space are labeled A through D, and the
objective function is indicated as a dotted line. The initial solution is indicated as the origin.
Q: Good. Do you see anything unusual about this graph?
A: Not really, no.
Q: How do we get started, then, working through the algorithm?
A: You show the solution at the origin, as in Table 6:
Variable
X
Y
Sl1
Sl2
Value
0
0
+
+
Origin
Red. Cost
+3
+1
0
0
Sl3
+
0
Table 6: First Solution - Complete
Q: Is the current solution optimal?
A: No, because the decision variables both have a positive reduced cost, which tells us the total profit
would increase if gave one or both of these non-basic variables a positive value.
Q: What happens next in the algorithm?
A: Well, we have evaluated the search directions (calculated the reduced costs), so we pick the search
direction (non-basic variable) with the best reduced cost, which would be X, and create a new solution
where X has the highest value it can get.
Q: What would that mean on the graph?
A: We move to the right on the X-axis until we reach corner point D, as shown in the following table and
graph:
Variable
X
Y
Sl1
Sl2
Sl3
Origin
Point D
Red.
Red.
Value
Value
Cost
Cost
0
+3
+
0
0
+1
0
+0.25
+
0
+
0
+
0
+
0
+
0
0
-1
Table 7: Second Solution
Y
A
1
B
2
C
O
3
D
Figure 5: Second Solution
X
Q: Is the solution at corner point D optimal?
A: No, because there is still a positive reduced cost (effect on the objective) for one of the non-basic
variables (Y).
Q: What comes next?
A: We increase the value of Y, and according to the graph, decrease – slightly – the value of X (which is a
worthwhile tradeoff because the reduced cost is positive), until we arrive at corner point C, as shown in
the table and graph at the top of the next page.
Q: Is the solution at corner point C optimal?
A: Yes, because all the reduced costs are negative or zero, so there are no further improvements in the
objective function to be found.
Q: So where is the special case?
Y
Var.
X
Y
Sl1
Sl2
Sl3
Origin
Point D
Val
R/C
Val
R/C
0
+3
+
0
0
+1
0
+0.2
+
0
+
0
+
0
+
0
+
0
0
-1
Table 8: Optimal Solution
Point C
Val
R/C
+
0
+
0
+
0
0
-1
0
0
A
1
B
2
C
3
D
O
Figure 6: Optimal Sol’n
X
A: Look carefully at the reduced cost values for each variable and look for anything unusual.
Q: Is it unusual for a non-basic variable to have a reduced cost of zero?
A: Yes, it is.
D: A basic variable has a reduced cost of zero because it can have no further effect on the objective (it is
already at its maximum value). A non-basic variable, if it were to become basic, would be expected to
have SOME effect on the objective, either an improvement (meaning you have to do another iteration
of the algorithm) shown by a positive value, or a negative value showing the objective would get worse
(meaning you are finished).
Q: What does a reduced cost value of zero for a non-basic variable tell us?
A: It tells us that we could make the non-basic variable into a basic variable and there would be no change
at all in the objective function value.
Q: Wouldn’t making a non-basic variable into a basic variable move us to another corner point, meaning
we have a different solution?
A: Yes, and that is what makes this a special case. Normally, LP gives a single solution (corner point)
that is THE optimal solution. If you change the solution at all, then you give up some profit (or
increase cost). In the alternate special case, though, there is more than one corner point with the exact
same total profit (or cost), so you get to choose.
Q: How can two corner points have the same total profit?
A: Look at the graph. Notice the objective function (the dotted line) is parallel to the second constraint
line. That means every point on constraint line #2 will have the exact same total profit. Since corner
points B and C lie on constraint line #2, they both have the same total profit. We happened to find
corner point C first, and since no further improvements were possible, the algorithm stopped. If,
however, we forced the algorithm to move on to corner point B, we would move from being on
constraint line #3 (Sl3 is used up, non-basic) to being on constraint line #1 (Sl1 is used up, non-basic).
Thus Sl3 enters the basis while Sl1 exits, a normal iteration except that the objective function doesn’t
change.
Q: Why did you call this an opportunity?
A: Compare corner points B and C. Notice that X and Y have different values at the two points. Notice
also that different resources (slack variables) are left over. You have a choice as to how much to make
of each product and which resource you have left over. You get to make this decision by considering
something other than total profit. That is an opportunity for you and your company to get an
advantage you would not normally have.
Q: Does this complete the second special case?
A: Yes, and the following graph shows the third special case:
Y
1
B
2
C
A
3
D
O
E
4
X
Figure 7: Infeasible Special Case
Q: Do you notice anything unusual about the graph in Figure 7?
A: I’m not sure I notice anything usual about it.
Q: What do you see?
A: It is a graph of two variables, X and Y, with four constraint lines (numbered), and one of the solution
spaces has five corner points, labeled A through E.
Q: One of the solution spaces?
A: There appears to be a second solution space, above and to the right of the first, created by constraint
line #2, but that line is not shaded toward the origin, as it should be.
Q: Is there anything else unusual about Figure 7?
A: There is another constraint line (#4) that is shaded above rather than below, and the origin is indicated
as the current solution, but it is not part of the solution space.
Q: What are the constraint lines that are shaded up and to the right?
A: The constraint lines that are shaded down-and-left are < - constraints, so constraints that are shaded upand-right must be > - constraints. In an earlier set of notes, I spoke of these as contracts that must be
met.
Q: So this graph has two resource constraints (#2 and #3, <) and two contract constraints (#1 and #4, >)?
A: Yes. You might think of it as the two resources are used to meet the two contracts.
Q: Why isn’t the origin part of the solution space?
A: When dealing with a contract, it would be unusual for doing nothing (the origin) to satisfy a contract.
Q: Can we still start at the origin, if it is not longer a feasible solution (part of the solution space)?
A: Yes, but we will need a trick to manage it. Let’s start by setting up a solution table the way we have
for the other two special cases. So, …
Q: What is the list of variables for this problem?
A: X and Y, of course, and the slack variables for the < - constraints, so Sl2 and Sl3.
Q: What would we do with the two > - constraints?
A: A slack variable goes with a < - constraint, to indicate leftover resources, but we use a surplus variable
for a > - constraint, to indicate how far over the contracted minimum we have gone.
Q: Why would we go over a contract minimum?
A: Normally you wouldn’t want to, but you might be forced to if you had more than one contract to
satisfy. The surplus variable is there in case you need to go over the minimum, not because you have
to go over the minimum. Now we have the list of variables shown in Table 9:
Origin
Variable
Value
Red. Cost
X
0
+3
Y
0
+1
Su1
0
-2
Sl2
+
0
Sl3
+
0
Su4
0
-4
Table 9: First Solution
Q: Why do Su2 and Su4, the surplus variables, have values of zero?
A: Looking at a graph, the slack variables have positive values because the solution point (the origin) is
below (down and left) the < - constraints. Surplus variables, though, measure being above a constraint
line, but the solution point is not above the > - constraint lines, so the values of the surplus variables
are zero.
Q: Shouldn’t the values of the surplus variables be negative, since the solution point is below the > constraint lines?
A: The non-negativity constraints do not allow any variables to have negative values.
Q: How many basic variables do we have?
A: Two, Sl2 and Sl3.
Q: How many should we have?
A: We should have four, because there are four constraints.
Q: Where will we get the other two?
A: That’s the trick I mentioned earlier, and it is based on the negative values for the surplus variables (that
we did not allow) and the infeasibility of the origin as a solution.
Q: How does the trick work?
A: We create a new kind of variable, called an artificial variable, to measure the distance the solution
point lies below a > - constraint. The artificial variable is measuring being on the wrong side of the
constraint line.
Q: What is the interpretation of the artificial variable?
A: An artificial variable measure how infeasible the current solution is. In simpler terms, it measures how
far you have to go to satisfy the contracts.
Q: When do we use an artificial variable?
A: Any time there is a > - constraint or an = - constraint, we use an artificial variable to measure the
infeasibility of the origin as the initial solution.
Q: What is an = - constraint?
A: A very strict contract, where you are not allowed to be over or under the constraint limit.
Q: What if the origin is feasible, that is a > - constraint or = - constraint goes through the origin?
A: Then you would have a degenerate special case, and the artificial variable, even though it has a value
of zero, is still treated as a basic variable.
Q: If an artificial variable means the solution is infeasible, then how do we get rid of them?
A: The normal way, by making a basic artificial variable into a non-basic artificial variable. To ensure
that this happens, we give the artificial variable an unacceptable objective function value (large
positive value if we are minimizing costs, or negative value if we are maximizing profits).
Q: How do we get started?
A: With Table 10, in which all of the variables for this problem are now shown:
Origin
Variable
Value
Red. Cost
X
0
+3
Y
0
+1
Su1
0
-2
Sl2
+
0
Sl3
+
0
Su4
0
-4
A1
+
0
A4
+
0
Table 10: Complete Initial Solution
Q: Which non-basic variable will enter the collection of basic variables?
A: X, because it has the highest reduced cost. This will move us to the right, along the3 X-axis, to corner
point E. This solution and graph are shown below:
Variable
X
Y
Su1
Sl2
Sl3
Su4
A1
A4
Origin
Point E
Red.
Red.
Value
Value
Cost
Cost
0
+3
+
0
0
+1
0
+0.25
0
-2
0
-2
+
0
+
0
+
0
+
0
0
-4
0
+3
+
0
+
0
+
0
Table 11: Second Solution
Y
2
B
1
C
A
O
D
3
E
4
Figure 8: Point E Solution
Q: What was the exiting variable?
A: The artificial variable for constraint line #4. An artificial variable measures being below the constraint
line, but corner point E is on constraint line #4, so the artificial variable becomes non-basic and we are
a little closer to having a feasible solution.
Q: Why isn’t there a value shown for A4?
A: Once an artificial variable becomes non-basic, it will never again become basic, so by convention, nonbasic artificial variables aren’t shown.
Q: Is the current solution feasible?
A: No, because the artificial variable for constraint line #1 still has a basic value, so we have not yet
satisfied that contract.
Q: Is the current solution optimal?
A: No, because there are still non-basic variables with positive reduced costs.
Q: What will the entering variable be?
A: Su4, the surplus variable for constraint line #4.
Q: Why are we moving above constraint line #4?
A: We have to if we ever want to satisfy the other contract, constraint #1.
Q: Where will that put us on the graph?
A: From corner point E, the only direction that moves us above constraint #4 is to continue along the X –
axis, to corner point D. This is shown in the following table and graph:
X
Y
Var
X
Y
Su1
Sl2
Sl3
Su4
A1
A4
Origin
Point E
Val
R/C
Val
R/C
0
+3
+
0
0
+1
0
+0.25
0
-2
0
-2
+
0
+
0
+
0
+
0
0
-4
0
+3
+
0
+
0
+
0
Table 12: Third Solution
Point D
Val
R/C
+
0
0
+0.7
0
-4
+
0
0
-3
+
0
+
0
2
B
1
C
A
3
D
O
4
E
Figure 9: Point D Solution
Q: Is the current solution feasible?
A: No, A1 is still basic, so we have not satisfied the contract for constraint #1.
Q: Is the current solution optimal?
A: No, because the non-basic variable Y still has a positive reduced cost.
Q: What comes next?
A: We make Y a basic variable, moving up and left along constraint line #3, slightly decreasing the value
of X, until we reach corner point C, as shown in the following table and graph:
Var
X
Y
Su1
Sl2
Sl3
Su4
A1
A4
Origin
Point E
Point D
Val
R/C
Val
R/C
Val
R/C
0
+3
+
0
+
0
0
+1
0
+0.25
0
+0.7
0
-2
0
-2
0
-4
+
0
+
0
+
0
+
0
+
0
0
-3
0
-4
0
+3
+
0
+
0
+
0
+
0
+
0
Table 13 & Figure 10: Fourth Solution
Point C
Val
R/C
+
0
+
0
0
-2
0
-0.5
0
-1
+
0
+
0
Y
2
B
1
C
A
3
D
O
E
4
X
X
Q: Is the current solution feasible?
A: No, A1 still has a positive value.
Q: Is the current solution optimal?
A: Yes, because all the non-basic variables have a negative reduced cost.
Q: Does that make any sense?
A: No.
Q: How can an infeasible solution be optimal?
A: Remember how stupid a computer is. It has been given a very limited definition of optimality: when
the reduced costs say there are no further improvements. Well, at corner point C, no further
improvements are possible.
Q: If the solution is still infeasible, though, don’t we need to make further improvements?
A: We need to, yes, but we can’t.
Q: Why can’t we make further improvements?
A: Remember that I said the resources were there to be used to satisfy the contracts. At corner point C,
we have used up all of our resources. Simply put, we don’t have enough resources to satisfy the
contracts we have agreed to. That is what the graph is showing you with the separate solution spaces.
The upper one if where you have to be to satisfy the contract, while the lower one is where you can be
based on the amounts of the resources that you have.
Q: Is it that easy to see on a printout?
A: Actually, it is usually even easier to see on a printout, because whatever software you are using will
probably flash a big message at you saying “INFEASIBLE.” Solver isn’t one of those, by the way. It
gives you a tiny little message, that an awful lot of my students have managed to overlook at one time
or another.
Q: How would we tell there was an infeasible special case if the software didn’t give us any warning at
all?
A: In that case, you would look for an artificial variable that had a positive value in the optimal solution.
Q: Is that a bad thing?
A: That is a very bad thing, because it tells you that there is still a contract to satisfy, but the computer
can’t find any way to satisfy it. Of course, that might not actually be true.
Q: What do you mean, “… it might not be true?”
A: Well, something over 99% of the time, when you get an infeasible solution, it is because you made a
mistake, not because the solution is really, truly infeasible.
Q: What kind of mistake would cause an infeasible solution?
A: Lots of kinds. Typo’s for one thing. Suppose you meant to type in a resource value of 100, but you
put in only 10. Misplacing 90% of your resource might make it hard to meet your contracts. The first
thing you should do when you get an infeasible solution is check your data entry and look for mistakes.
Q: Let’s suppose I checked my data entry and it was all perfect, but I was still getting an infeasible
solution?
A: Then you would check the sources of your data. Call down to inventory control and ask them to verify
the numbers you have. Imagine this conversation:
You: “Excuse me, but I need to check on some numbers I got from you yesterday. Did you say that we
have 10 of resource 1?”
Clerk: “Yes, that’s right, 10 cases”
Q: Does that solve your problem?
A: If there is more than one item per case, almost certainly.
Q: OK, so I check my typing, and it is fine, and I check my data, and it is correct. What if I am still
getting an infeasible solution?
A: “When in danger, or in doubt, run in circles, scream and shout.” Panicking won’t help, but it is good
exercise. If you really and truly have an infeasible problem, then you cannot use the “optimal”
solution that the algorithm has found. What this is really telling you is that the problem cannot be
solved by the LP algorithm.
Q: So there is not solution?
A: I didn’t say that; I said LP can’t find a feasible solution. What you have to do now is get creative.
Consider this situation:
Your boss comes to you and asks you to survey 500 of your customers to find out whether they would
prefer red or blue for the new color of your shipping cartons. You ask if you have a budget, and she
says, “Yes, $500.” You politely point out that last time such a survey was done, it cost over $2.00 per
survey (printing the letters, mailing, re-mailing to those that don’t respond, collating the responses that
do come in, generating a report), and your boss says she has great faith in you (bosses always have
great faith in you when they are asking you to do something impossible).
Q: What should you do?
A: Get creative.
Q: What does that mean?
A: An infeasible problem usually means that you have asked the wrong question. Let me illustrate this
with a couple of old stories:
Back in the 1960’s, a luxury high-rise apartment building had just been opened in a major city. It was
perfectly located to be near the business district, and almost immediately was filled with executives
wanting to live close to their work. Almost as quickly, the complaints started that the elevators were
too slow. The managers looked into putting in faster elevators, but being a new building, the elevators
were already as fast as possible. Adding an elevator was ruled out due to cost. Eventually, as the
complaints continued, the managers brought in an engineer to try to find a solution. Being an engineer,
he began to quantify the problem, using the security cameras to time how long people were waiting.
His data didn’t show any really excessive wait times, so he advised the managers to ignore the
complaints. The managers insisted he come up with a solution, so he did. He told them to install
mirrors next to every elevator door.
Q: Did that help?
A: The complaints dropped to nearly zero (there will always be someone who complains, no matter what
you do).
Q: How did installing mirrors speed up the elevators?
A: It didn’t. The problem wasn’t that the elevators were too slow; the problem was that the people
waiting for the elevators were bored. The engineer figured that if they gave the people something to
do while waiting (no one is ever bored while looking at their own reflection), then the complaints
would stop.
Q: How did the engineer come up with that solution?
A: By changing the question from “How do we speed up the elevators?” to “How do we stop the
complaints?” The managers were asking a question for which there was no feasible solution.
Changing the question found a solution (by the way, the next time you are in a tall building waiting for
an elevator, look around to see if there is a mirror nearby). The next story makes the same point:
Back in the 1970’s, when London’s Heathrow airport was being renovated, it was heralded as a
miracle of efficient layout and state-of-the-art convenience. No sooner did they open the new terminal,
however, than the complaints started about having to wait for luggage to show up (I can sympathize,
I’ve flown through Heathrow). Once again, the engineers were called in to find a solution. I like this
story because of one of the proposed solutions: using a huge vacuum system to suck the luggage out of
the airplanes and into the sorting area (as if human luggage handlers don’t do enough damage).
Imagine what would happen if the lock on your suitcase failed? Imagine how your pet would look
(they often travel in the luggage area) after being sucked through this thing. Fortunately, saner minds
prevailed and the idea was turned down (but they are lovely images though, all your clothes coming
out on the carousel one at a time, and you getting to collect them in front of everybody). Anyway, they
eventually found a solution.
Q: What did they do, put mirrors in the waiting area?
A: No, though there usually are a lot of mirrors in airports. The solution was to re-route the passengers so
it took them at least twice as long to get from the gates to the luggage carousels. It seems the original
layout was too efficient, and the luggage handling system simply couldn’t keep up. With the new
layout, by the time the passengers arrived, the luggage soon showed up as well. The question was
changed from “How do we speed up luggage handling” to “How do we slow down the passengers?”
Q: How does this help us?
A: The point of the two stories is that when faced with an infeasible situation, some people throw their
hands in the air, wail and moan, and give up. Others get creative and find a way around the
difficulties. Hopefully, you know which type your bosses would prefer you to be.
Q: How does this help us with the survey our boss has asked up to do?
A: Well, we can’t do it with mirrors, so and we don’t have enough money to do a mass mailing, so how
about changing the question from “How do we mail 500 letters for less than $500?” to “How do we
contact 500 customers for less than $500?”
Q: Why not find 500 customers that have e-mail addresses and send them that way?
A: Problem solved.
Q: So what do we need to know about infeasible special cases?
A: If you get an infeasible solution, first check for your mistakes. If there weren’t any, DO NOT use the
solution. Instead, identify the problem (LP can help with this, by telling you which contract wasn’t
met) and try to find a solution that bypasses the problem.
Q: Didn’t you say there were four special cases?
A: Yes, so there is only one to go – the Unbounded special case.
Q: What does the graph for this one look like?
A: Like Figure 11:
2
Y
1
A
B
3
O
C
X
Figure 11: Unbounded Special Case
Q: What do you see in this graph?
A: A problem with two decision variables (X and Y) and three constraints. Constraint #1 is a > constraint, but the other two look funny. Also, the solution space is open on the upper-right.
Q: What does it mean for the solution space to be open on the upper-right?
A: It normally means we have a minimization objective and the problem is not bothering to list out the
resource constraints. This happens when you know you have or can get sufficient resources to meet
your contracts. Unfortunately for us, our problem is maximization, not minimization.
Q: What is odd about the other two constraints?
A: They are sloped the wrong way.
Q: What does it mean when a constraint is sloped from the lower-left to the upper-right?
A: It means the line has positive slope, which oddly enough means that one of the variables has a negative
coefficient. This would occur if one product (say, variable X) has a by-product of something that the
other product (variable Y) needs. The by-product is the constraint, and can be either a resource or a
contract.
Q: Are constraints#2 and #3 resources or contracts?
A: Test the origin to find out. Even without the constraint equations, we can figure it out. Whatever the
coefficients are for X and Y, when X and Y are zero, the left-hand side of the equations become zero.
Unless the constraint limits are negative (highly unusual), then zero must be less-than-or-equal to the
constraint limit, making these < - constraints. This gives us the following solution:
Origin
Variable
Value
Red. Cost
X
0
+3
Y
0
+1
Su1
0
-2
Sl2
+
0
Sl3
+
0
A1
+
0
Table 14: Complete Initial Solution
Q: Is the initial solution optimal?
A: No, because both X and Y have positive reduced costs, and since you told us we were maximizing, this
means we can improve on our solution by making some X and moving to corner point C on the graph.
This solution is shown in the following table and graph:
Y
2
1
Variable
X
Y
Su1
Sl2
Sl3
A1
Origin
Red.
Value
Cost
0
+3
0
+1
0
-2
+
0
+
0
+
0
Point C
Red.
Value
Cost
+
0
0
-1
0
+2
+
0
0
0
Table 15: Point C Solution
A
B
3
O
C
X
Figure 13: Point C Solution
Q: What do you see from the solution in Table 15?
A: The artificial variable exited the solution, so we satisfied our contract. Interestingly, we also used up
all of resource three, so we have a degenerate solution. The current solution is not optimal, because we
can increase our profit by creating surplus (moving above-right) for the contract shown as constraint
#1.
Q: If we have a degenerate solution, shouldn’t there be three constraints intersecting at corner point C?
A: There are three constraints, #1, #3, and the X-axis, representing one of the non-negativity constraints.
Q: Along which line will we move on our next iteration?
A: To stay feasible, we will move along constraint line #3; if it were a clock, we would be moving toward
two o’clock.
Q: What corner point will we stop on?
A: There is no corner point out along constraint #3, so I don’t know where we will stop.
D: Neither does the computer, so it stops and prints out the corner point C solution as if it were optimal.
Q: How can corner point C be optimal if there are still positive reduced costs?
A: That is what makes this the unbounded special case.
Q: Why is this called unbounded special case?
A: It is a literal description of the solution space, which is open (unbounded) on the upper-right.
Q: How do we identify this special case from an LP printout?
A: Most programs will give you a big flashing message saying UNBOUNDED, but not all of them. For
those that don’t, you have to look at the reduced costs. If you see positive and negative reduced costs
for an allegedly optimal solution, you know you have an unbounded special case.
A word of warning – programs that do give you the UNBOUNDED warning often re-interpret the
reduced costs, showing some positive and some negative based on the type of constraint (<, >). Do not
be fooled into thinking you have an unbounded special case when they do this. Solver gives a very
small unbounded warning, and does reinterpret the reduced costs. If I give you an unbounded special
case on a test, I will put in a set of reduced costs labeled “True Reduced Costs” and you will use them
to determine whether or not this special case is present.
Q: Is it possible to have two special cases at a single corner point?
A: Sure, we just did it. Corner point C is both degenerate and unbounded. You can actually combine all
four special cases into a single corner point, though it looks a little weird.
Q: What do we do if we get an unbounded special case?
A: Well, there is good news and bad news.
Q: What is the good news?
A: The good news is that there are no unbounded special cases in the real world, so we know that this
simply means we have made a mistake somewhere, unlike the infeasible special case where it was
possible that the problem really was infeasible.
Q: How do we know there are no unbounded cases in the real world?
A: There is always something that limits the solutions available to you – time, money, resources, people,
something. Since we know this is true, we know that whatever problem we are trying to solve is
bounded, and the unbounded solution is a mistake on our part.
Q: What’s the bad news?
A: The bad news is that we have made a mistake, and now have to find it.
Q: Can you give us any hints?
A: The most likely mistake is the one you noticed back at the start of this special case – that the graph
looks like a minimization problem. The quickest way to get an infeasible special case is to set up a
minimization problem and put in the wrong objective.
Q: By the way, how did you know this was a maximization problem?
A: There can never be an unbounded minimization problem. This is true because the non-negativity
constraints provide an automatic lower bound to the solution space.
Q: What is the second fastest way to get an unbounded solution?
A: If you enter a constraint backwards (> when it should have been <) this will sometimes cause an
unbounded problem.
Q: Are there any other likely causes?
A: Yes, but this one is a pain. As mentioned above, there is always something that limits your possible
solutions. This means that if you meant to maximize and you didn’t make any typos, then you left out
a constraint. The problem is, you have no idea what that constraint may be. You can’t just pick any
resource, because you may not pick the most binding resource. You can put in all resources, but that
can make for a huge problem. As I said – this one is a pain, no matter how you solve it.
Q: Is that the end of the special cases?
A: Yes, it is.
Q: Did we learn anything?
A: You hopefully have a better idea of how the LP algorithm searches around the border of solution
space. You have also gained a working knowledge of how slack, surplus and artificial variables
function. You should understand what reduced costs tell you.
Q: What haven’t we learned?
A: You haven’t learned how to use the sensitivity analysis effectively and you haven’t learned how to
adjust a formulation to answer questions (as we did in the transportation case). On the bright side, I’ll
be giving you a case so you can learn those things by doing them. Aren’t I nice professor?
Download