Sie sind auf Seite 1von 6

BRIEF MANUAL FOR LINDO FOR WINDOWS

MSC 385 Classes, UAH


{Updated 05/07/2001}

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

Figure 1. Opening Window for LINDO Startup.

Figure 2. Example Problem Entered into LINDO Model Window.


Note that LINDO recognizes the symbol < as meaning less than or equal to. You may also use <= instead of the < symbol.

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.

LINDO for Windows Manual

MSC 385

Dr. Stafford

Page 2

The SOLVE button looks like this:

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.

Figure 3. SOLVE Command

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

Elapsed Time Update Interval

Figure 4. Solver Status Window

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.

Obtaining the LINDO Solution


When you choose NO for sensitivity analysis, a new window appears within the Model Window. This is the Reports Window which contains the basic solution to the linear programming problem. (It may be behind the Solver Status window; if so, click on it to bring it to the front.) This window contains the basic solution to the current problem. The solution for our example problem is shown in Figure 5.

LINDO for Windows Manual

MSC 385

Dr. Stafford

Page 3

LP OPTIMUM FOUND AT STEP

OBJECTIVE FUNCTION VALUE 1) 792.0000 REDUCED COST 10.200000 0.000000 0.000000

VARIABLE VALUE X1 0.000000 X2 4.000000 X3 48.000000

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

Figure 5. Optimal Solution.


The optimal solution took two iterations of the simplex. The solution calls for making 4 units of X2 and 48 units of X3. Profit = 12 X1 + 18 X2 + 15 X2 = 12(0) + 18(4) + 15(48) = 0 + 72 + 720 = $792. As a result of this production combination, we have used all of the machine and material resources (slack/surplus = 0.00). There are 56 hours of labor remaining, and we are 12 units short of the maximum production of 16 X2's allowed by the constraints.

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)

LINDO for Windows Manual

MSC 385

Dr. Stafford

Page 4

Figure 6. Window for Loading Example Problem from A Drive.

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

ROW MACHINE LABOR MATERIAL PRODUCT2

Figure 7. Sensitivity Analyses of Optimal Solution.


(c) Change X1's profit to $22. X1 is currently not in solution. Further, from Figure 5, its reduced cost is 10.20. That is, the current coefficient of $12 is $10.20 too low to make X1 competitive in the optimal solution. So by raising it $10 to $22, we still will not change the current optimal solution, and the current profit of $792 will remain optimal. Reduce available labor by 10 hours. Look at Labor in Figure 5. Currently there are 56 excess hours of labor unused in the current optimal solution. So if 10 are removed, there would still be 46 excess hours of labor, and the current solution will not change. Allow X2 to be as great as 20. Currently, X2 can be as large as 16; but in the optimal solution, its value is 4. So raising its allowable limit to 20 will change nothing. The current solution remains optimal. Change all profits by +$1 per unit. From Figure 7, all objective function coefficients may be increased $1 without changing the optimal solution contents: 0 X1's, 4 X2's, and 48 X3's. But the value of the objective function will become (13)(0) + (19)(4) + (16)(48) = 0 + 76 + 768 = $844. This is equal to 52 units x $1 increase = $52 + 792 = $844.

(d)

(e) (f)

LINDO for Windows Manual

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.

LINDO for Windows Manual

MSC 385

Dr. Stafford

Page 6

Das könnte Ihnen auch gefallen