Design Decision Support Systems


Course Number: 17723

Tutor: Joe Nappa

Linear Programming Tutorial

LinPro (PPC)

A Linear Programming Application

1. Introduction

Numerous computer programs are available today to carry out the computations needed to find the optimum solution to problems formulated as linear programs. LinPro is designed to solve and analyse linear programming (LP) models, and is capable of dealing with models up to 100 variables and 100 constraints. It uses the simplex method to arrive at solutions. It also enables the user to undertake sensitivity analyses of the results.

 

The program itself is found inside the LinPro folder in Applications folder on all the Power Macintoshes in the Computing Laboratory.

 

WARNING! Keep your LinPro input files on your own diskette or in your home directory.

 

2. Model Sizes

 

limits – version 1.1 of LinPro (PPC) supports models up to 100 decision variables and 100 constraints.

 

all decision variables are assumed to be non-negative

 

3. Sample Problem

 

Suppose we have been asked to commence the preliminary design of a small complex of apartments. Our studies show that 1-bedroom and 2-bedroom apartments are the most desirable in this area. Our client has pointed out that there is, at most, demand for only three 3-bedroom and six 2-bedroom apartments and, consequently, has requested that no more than this number be built. Our objective is to find the number of 1-bedroom, 2-bedroom, and 3-bedroom apartments that will maximise the financial return.

 

The following costs and profits have been ascertained:

 

Apartment Type

 

Capital Cost

(in $1,000s)

 

Profit

(in $1,000s)

 

 

1-bedroom

 

90

 

20

 

2-bedroom

 

180

 

24

 

3-bedroom

 

220

 

27

 

The available capital is $1,800,000. If maximising profit were the only criterion, clearly, it would be most advantageous if we built all 1-bedroom apartments. However, the local planning authority has a planning code that discourages small apartments by placing penalties against them. For this site, the maximum number of penalty points a development can accrue is 960. The following penalties are incurred for each unit:

 

 

Apartment Type

 

Penalty Points

 

 

1-bedroom

 

120

 

2-bedroom

 

60

 

3-bedroom

 

20

 

 

The decision variables here are the number of 1-bedroom, 2-bedroom, and 3-bedroom apartments we should design. Let us call them x1, x2, and x3, respectively. We can write the objective (in thousands of dollars) in terms of these variables as maximising:

 

20x1 + 24x2 + 27x3

 

The restrictions are imposed on the values that x1, x2 and x3 can take by the constraints of available capital, planning policy, and demand. These constraints, too, can be expressed in terms of the decision variables:

 

 

90x1 + 180x2 + 220x3 £ 1,800

120x1 + 60x2 + 20x3 £ 960

x2 £ 6

x3 £ 3

 

3.1 Data Entry

 

model window – after double-clicking on the LinPro icon, and then getting past the introductory messages, the program opens with an empty window called Untitled (so-called because it has not been saved yet). Type-in your model in that window:-

 

1. Type the keyword "min" or "max" for minimise or maximise (see Fig 1) — it does not matter whether you use upper- or lowercase (e.g. it is acceptable to write "MIN" or "Min".

 

2. Skip a space after the keyword, and enter your objective function; press the Return key.

 

3. On the new line, enter the keywords "subject to" (again, case does not matter); press the Return key.

 

 

 

 

Figure 1 – LinPro's model entry window

 

4. Then, on separate lines, enter each of the constraint expressions. Do not enter expressions constraining the variables to being non-negative—this is implicit in the application.

 

5. You can insert comments in your model by using the character "!". When LinPro meets this character, it simply ignores all the following characters until the end of the line. Placing comments in your model is recommended.

 

You are now ready to optimise your linear programming model.

 

saving your model - you may use the Save command (see Fig 2) from LinPro's File menu to save your model (and your Solution windows once they're generated via the Optimize Model command).

 

 

Figure 2 — LinPro's File menu

 

naming – when you enter your model in the model window, you may use whatever variable name you think is most appropiate. You may name a variable

 

"x1" or "X1" or "ProductA". Use a name that is meaningful but not so long as to make your model look clumsy.

 

data editing – use the cursor and the Delete key to alter data already typed in.

 

• inequalites – when you write a less-than-or-equal constraint, you may use <=, <, or "d.

- when you write a more-than-or-equal constraint, you may use >=, >, or "e

 

• program options - you may go to the Model menu (see Fig 3) to select the Options... command. This brings up the Options dialog box (see Fig 4). Use this dialog to select some options before optimising the model—just check the boxes corresponding to the options of your choice.

 

 

Figure 3 — LionPro's Model menu

 

 

Figure 4 — LinPro's Options dialog box

 

3.2 Optimising the Model

 

Once you have set out your linear programming model, you may optimise it by selecting the Optimize Model command from the Model menu (see Fig 3). Provided there are no errors, a solution window (see Fig 5) should then appear.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5 — LinPro optimisation solution window (simplest form)

 

 

3.3 Final Solution

 

Amongst other results, the optimisation solution window displays the optimal values for the decision variables. The column headed Optimal Value, in Fig 5, above, lists these values. So summarising:

 

Z = 279.222

X1 = 5.778

X2 = 3.444

X3 = 3.0

 

 

So, after rounding-off the optimal values so that they're integers, and checking that they still satisfy the constraints, the optimal solution can be re-written as:

 

 

Number of 1-bedroom apartments = 6

Number of 2-bedroom apartments = 3

Number of 3-bedroom apartments = 3

Profit = $273,000

 

 

3.4 Sensitivity Analysis

 

Sensitivity refers to the amount by which an optimal performance is affected by changes in the problem conditions. A question one might ask is how sensitive is the optimal return to a change in, say, land available to build on. We gain nothing in arguing with the planning authority, say, to build more dwellings if it turns out that the constraint at issue is not one that affects the decisions.

 

Examination of these issues once the optimum has been determined is called sensitivity analysis.

 

From LinPro's Options dialog, you can elect to have a sensitivity analysis performed and the results displayed in the Solution window. Sample results are tabulated below in figures 6 and 7.

 

 

 

Figure 6 — first part of LinPro Solution window (with sensitivity option)

 

 

Note the significance of the results shown in these three tables.

 

The Model Value column in the first table of Figure 6 shows the contributions of each decision variable to the objective. So, for example, each additional unit of X1 (i.e. each 1 bed apartment) contributes $20,000 (20.0 x $1000) to the profit. Because the Allowable Increase column gives a figure of 28.000, this means that the profit from each 1-bedroom apartment built may be increased by a further $28,000, to $48,000 before there is a change to the optimal values of the 3 decision variables. Practically speaking, of course, this allowed increase in profit is only achievable by increasing sale price if construction cost is constant. Therefore, the sale price of 1-bed apartments may be increased to $138,000 (i.e. $90,000 plus $48,000) before this set of optimal decision variable values is affected.

 

The Shadow Price column in second table of Figure 6 shows the contribution to the optimal objective function value of a 1 unit change in each constraint’s right-hand value. For example, an increase in the marketable number of 3 bedroom apartments from three to four will contribute a $2,407 (2.407 x $1000) increase to the final profit.

 

The second table in Figure 6 gives the lower and upper limits for the ranges of each constraint’s right-hand side, over which the tabulated shadow price values remain constant. So, for example, if one examines the slack variable that corresponds to the fourth constraint—SLK 4—one sees that the contribution to the objective remains at $2,407 per unit change in the marketable number of 3

 

 

bedroom apartments from a minimum of 1.317 (i.e. 3 minus 1.683) up to a maximum of 5.268 3-bed apartments.

 

An allowable increase of INF (i.e. an infinite increase), as indicated in the SLK 3 row in Figure 6, implies that "infinite" demand for 2-bed apartments would have no effect on the calculated optimal values.

 

 

Figure 7 — Final Tableau from LinPro Solution window (with sensitivity option)

 

 

The usefulness of the Final Tableau (see Figure 7) can be demonstrated by looking at one of the slack variable columns—SLK 4, say. Remember that SLK 4 corresponds to the fourth constraint in our model—the maximum demand for 3-bed apartments. An increase in demand by 1 unit will mean 1.519 fewer 2-bed apartments should be built, and 0.593 more 1-bed apartments should, as a consequence, be built; an increase in overall profit, from that shown in the Optimal Value column ($279,222) of the table, of $2407 results from this change.

 

 

 

4. Tutorial Exercise

 

The above figure shows the dimensionless floor plan of an apartment. Find the minimum length of this apartment, subject to the constraints on the areas of the rooms and on their lengths.

 

For structural reasons, the right-hand wall of bed2 is to line-up with the right-hand wall of bath2. The width of the bath1, hall, and bath2 are specified, and hence the widths of all remaining rooms are fixed.

 

After determining the solution, carry out a sensitivity analysis.

 

Assignment #2