Chapter Contents 
Previous 
Next 
The LP Procedure 
Recall the linear programming problem presented in the "Introduction to Mathematical Programming" chapter. 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 integerconstrained 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 zeroone 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 one when gumdrops are manufactured. Also, you should include a constraint labeled ONLY_ONE that requires the sum of ICHOCO and IGUMDR to equal one. (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 one 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; input _row_ $10. 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.
Output 3.8.1: Summaries and an Integer Programming Iteration Log




Note that if you defined a SOSEQ special ordered set containing the variables CHOCO and GUMDR, the integer variable ICHOCO and IGUMDR and the three associated constraints would not have been needed.
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.