The LP Procedure |
Recall the linear programming problem presented in Chapter 1, "Introduction to Optimization." In that problem, a firm produces two products, chocolates and gumdrops, that are processed by four processes: cooking, color/flavor, condiments, and packaging. The objective is to determine the product mix that maximizes the profit to the firm while not exceeding manufacturing capacities. The problem is extended to demonstrate a use of integer-constrained variables.
Suppose that you must manufacture only one of the two products. In addition, there is a setup cost of 100 if you make the chocolates and 75 if you make the gumdrops. To identify which product will maximize profit, you define two zero-one integer variables, ICHOCO and IGUMDR, and you also define two new constraints, CHOCOLATE and GUM. The constraint labeled CHOCOLATE forces ICHOCO to equal one when chocolates are manufactured. Similarly, the constraint labeled GUM forces IGUMDR to equal 1 when gumdrops are manufactured. Also, you should include a constraint labeled ONLY_ONE that requires the sum of ICHOCO and IGUMDR to equal 1. (Note that this could be accomplished more simply by including ICHOCO and IGUMDR in a SOSEQ set.) Since ICHOCO and IGUMDR are integer variables, this constraint eliminates the possibility of both products being manufactured. Notice the coefficients -10000, which are used to force ICHOCO or IGUMDR to 1 whenever CHOCO and GUMDR are nonzero. This technique, which is often used in integer programming, can cause severe numerical problems. If this driving coefficient is too large, then arithmetic overflows and underflow may result. If the driving coefficient is too small, then the integer variable may not be driven to 1 as desired by the modeler.
The objective coefficients of the integer variables ICHOCO and IGUMDR are the negatives of the setup costs for the two products. The following is the data set that describes this problem and the call to PROC LP to solve it:
data; format _row_ $10. ; input _row_ $ choco gumdr ichoco igumdr _type_ $ _rhs_; datalines; object .25 .75 -100 -75 max . cooking 15 40 0 0 le 27000 color 0 56.25 0 0 le 27000 package 18.75 0 0 0 le 27000 condiments 12 50 0 0 le 27000 chocolate 1 0 -10000 0 le 0 gum 0 1 0 -10000 le 0 only_one 0 0 1 1 eq 1 binary . . 1 2 binary . ; proc lp; run;
The solution shows that gumdrops are produced. See Output 3.8.1.
The LP Procedure
|
The LP Procedure
|
The branch-and-bound tree can be reconstructed from the information contained in the integer iteration log. The column labeled Iter numbers the integer iterations. The column labeled Problem identifies the Iter number of the parent problem from which the current problem is defined. For example, Iter=2 has Problem=-1. This means that problem 2 is a direct descendant of problem 1. Furthermore, because problem 1 branched on ICHOCO, you know that problem 2 is identical to problem 1 with an additional constraint on variable ICHOCO. The minus sign in the Problem=-1 in Iter=2 tells you that the new constraint on variable ICHOCO is a lower bound. Moreover, because Value=0.1 in Iter=1, you know that ICHOCO=0.1 in Iter=1 so that the added constraint in Iter=2 is ICHOCO . In this way, the information in the log can be used to reconstruct the branch-and-bound tree. In fact, when you save an ACTIVEOUT= data set, it contains information in this format that is used to reconstruct the tree when you restart a problem using the ACTIVEIN= data set. See Example 3.10.
Note that if you defined a SOSEQ special ordered set containing the variables CHOCO and GUMDR, the integer variables ICHOCO and IGUMDR and the three associated constraints would not have been needed.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.