Beruflich Dokumente
Kultur Dokumente
What Is LINDO?
LINDO (Linear and Integer Discrete Optimizer) is a user friendly software package for solving linear programs, integer programs, and quadratic programs. In its new, Windows version, it is easy to use and very powerful. For MSC 385 classes, we use the student version of LINDO.
Where Is LINDO?
The College of Administrative Science, UAH, has a site license for Student LINDO. Students may access it in the student computer laboratory, second floor, Administrative Science Building. There is a trial version of LINDO available at: http://www.lindo.com/download.html. It is a demo version that allows up to 50 constraints and 100 variables - sufficient for our needs. The download size is 2.5 Megabytes.
Example Problem
The following linear programming problem is taken from the current textbook, Production Operations Management, 6th edition, 1999, W. J. Stevenson, McGraw-Hill. We shall use this problem to demonstrate how to use LINDO. Given the linear programming model, solve the model and then answer the questions that follow. Maximize 12 X1 + 18 X2 + 15 X3 subject to: Machine) 5 X1 + 4 X2 + 3 X3 ! 160 minutes Labor) 4 X1 + 10 X2 + 4 X3 ! 288 hours Material) 2 X1 + 2 X2 + 4 X3 ! 200 pounds Product2) X2 ! 16 units (a) Are any constraints binding? If so, which ones? (b) If the profit on product 3 was changed to $22 a unit (from $15), what would the values of the decision variables be? The objective function? Explain. (c) If the profit on product 1 was changed to $22 a unit (from $12), what would the values of the decision variables be? The objective function? Explain. (d) If 10 hours less of labor time were available, what would the values of the decision variables be? The objective function? Explain. (e) If the manager decided that as many as 20 units of product 2 could be produced (instead of 16), how much additional profit would be generated? (f) If profit per unit on each product increased by $1, would the optimal values of the decision variables change? Explain. What would the optimal value of the objective function be?
Entering a Model
When you start LINDO, your screen should look like Figure 1. The outer window is the main frame window. It contains the command menus, the command toolbar, and all other windows generated by LINDO. The smaller child window is a new, blank Model Window. It is labeled <untitled> until we rename it. We type our model directly into the Model Window. The first thing entered into a new model for LINDO is MIN or MAX, indicating the sense of your objective function. We type in the model as though we are typing in a word processor. There are a few general guidelines regarding LINDOs syntax, and we will discuss them presently. For now, let us proceed to type in the example problem. Start each new constraint on a new line. Note that the name of each constraint has a ) after it, followed by a blank space. It is good practice to put a space between each element of each constraint and the objective function. Notice that the last item in the model is the word END. When you are finished typing in the model, the Model Window should look like Figure 2.
LINDO for Windows Manual MSC 385 Dr. Stafford Page 1
Solving a Model
We can solve this problem in two different ways. On the menu bar, we can click the SOLVE menu, then choose SOLVE from that menu. This is shown in Figure 3 below. Or, we can use the SOLVE button on the tool bar.
MSC 385
Dr. Stafford
Page 2
Either way, when we solve the problem, we get the LINDO Solver Status window with a choice button to conduct sensitivity analyses, or not. For now, just click NO. The resultant window is shown in Figure 4. A brief discussion of the fields in the Solver Status window is in order. These are shown in the table below.
Status
Status of current solution: Optimal, Feasible, Infeasible, Unbounded. Number of iteration for solution.
Iterations:
Infeasibility
Amount by which the constraints are violated. Current value of the objective function. Objective value of the best integer solution found. Theoretical bound on objective for integer programming (IP) models. Number of integer variables branched by the IP solver. Elapsed time since solver was invoked How often (in seconds) the Status Window is updated. Do not use zero.
Objective
Best IP
IP Bound
Branches
Before we try to answer the questions about this solution, we should save the problem. Just as in most Windows applications, we can either click on the save icon to save, or go to the File Menu, and use either Save or Save As to save this problem. Save it as A:PbSu5_15" on your personal floppy disk. Note: at home, or on your personal computer, you need not save it to the A drive.
MSC 385
Dr. Stafford
Page 3
ROW SLACK OR SURPLUS DUAL PRICES MACHINE) 0.000000 4.200000 LABOR) 56.000000 0.000000 MATERIAL) 0.000000 0.600000 PRODUCT2) 12.000000 0.000000 NO. ITERATIONS= 2
Sensitivity Analyses
Now to answer the six questions posed about this solution. (a) Binding Constraints. A constraint is binding if it is all used up in the final solution. We can easily identify tight or binding constraints by the values of zero for the slack/surplus in the final solution. For this problem, the binding constraints are Machine and Material. The other constraints - - Labor and Product2 - are said to be loose. Change X3's profit to $22. We can find out the impact of this change in two different ways. We can either directly change the parameter value and re-run the problem, or we can do sensitivity analyses on the solution. Let us do the second option first. Because we elected not to do sensitivity analyses while we had a fresh solution, we must re-run the problem. WE need to go to the A drive to get our saved model. Most likely, it was not saved with the LINDO .ltx extension. Click on the open icon, or go to File, then Open, and specify the A drive. If the problem shows in the window, you gave it the .ltx extension earlier. If not, open the List files of type menu and click on All Files (*.*). You should see our problem as shown in Figure 6. Highlight the file we want (pbsu5_15) and click OK. Our problem, similar to Figure 2, should appear on your screen. Again, solve this problem; but this time, click YES to the question on sensitivity analyses. Close the Solver Status box and click on the Reports Window. In addition to the solution as shown in Figure 5, we have additional information on RANGING as shown in Figure 7. The ranging, or sensitivity analyses, is divided into two parts: (a) coefficients of the objective function; and (b) coefficient values of the right hand side (RHS) of the constraints. For this question, we are interested in part (a). For X3, the current coefficient is $15 and Ranging tells us this value can be increased by $21 (20.999998 in Figure 7 because of internal LINDO rounding), or decreased by $1.50 with no change in the optimal solution. That is, the optimal solution will remain X1 = 0.00, X2 = 4.00, and X3 = 48.00. Thus the new objective function value will be 12(0) + 18(4) + 22(48) = 0 + 72 + 1056 = $1128. The net gain is 1128 792 = $336, which is also ($7)(48). Since the prospective gain of $7 per unit falls within the range of +21, we know that the increase in profit will be (22-15)(48) = ($7)(48) = $336.
(b)
MSC 385
Dr. Stafford
Page 4
RANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGES CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE 12.000000 10.199999 INFINITY 18.000000 2.000000 7.285714 15.000000 20.999998 1.500000 RIGHTHAND SIDE RANGES CURRENT ALLOWABLE RHS INCREASE 160.000000 17.500000 288.000000 INFINITY 200.000000 13.333333 16.000000 INFINITY ALLOWABLE DECREASE 10.000000 56.000000 40.000000 12.000000
VARIABLE X1 X2 X3
(d)
(e) (f)
MSC 385
Dr. Stafford
Page 5
To verify the above analyses, take the original problem and make each change, one at a time. You should get the same results as claimed above using the sensitivity analyses (ranging) and basic information available in the optimal solution printout. For (b), change the objective coefficient of X3 to 22 and solve. The Reports Window shows a profit of $1128 with unchanged values for X1, X2, and X3. For (c), change the coefficient if X1 to $22. (Dont forget to change the coefficient of X3 back to $15.) As predicted by sensitivity analyses, the original optimal solution remains. For (d), change the RHS of the labor constraint to 278 (- 10 hours). Solve and the optimal solution remains the same, as predicted. For (e), change the RHS of Product2 constraint to 20, and solve. Again, the same optimal solution. Again, the same optimal solution. For (f), add 1 to each objective function coefficient, and solve. The profit is now $844 with 4 X2's and 48 X3's produced.
LINDO As an Editor
The LINDO Model Window can be used as an editor, just like a word processor. Or you could develop the model in a word processor, then copy it and paste it to the LINDO Model Window. This is a particularly useful step when many constraints are nearly identical except for variable subscripts or coefficient values. It will prove particularly useful when we model the assignment problem or transportation problem as a linear programming problem. Note that, as additional LINDO features prove helpful, they will be added to this handout. So check the updated date from time to time.
MSC 385
Dr. Stafford
Page 6