Problem Solving & Decision Making Support
Problem Solving & Decision Making Support
An Introduction to
Problem Solving & Decision Making
using Computer Software
(Selected Real World Problems)
Training Material
February, 2010
Contents
Section I
Page
Introduction . . . . . . . . . I-1
Classification of Problems in Operations Research . . . I-1
Sequencing Problems . . . . . . I-2
Allocation Problems . . . . . . I-8
Routing Problems . . . . . . . I-10
Replacement Problems . . . . . . I-11
Inventory Problem . . . . . . . I-11
Queuing Problems . . . . . . I-11
Competitive Problems . . . . . . I-12
Search Problems . . . . . . . I-12
Section II
Mathematical Modeling in Operations Research . . . II-1
Linear Programming Models (LP). . . . . . II-2
Formulation of Linear Programming Models . . . . II-3
Some Examples of LP Models . . . . . . II-4
Diet (Nutrition) Problem . . . . II-4
Television Problem . . . . . II-7
Product Mix Problem . . . . . II-8
Truck Production Problem . . . . II-11
Crop Farm Organization Problem . . . II-13
Machine Scheduling Problem . . . II-16
Petroleum Refining Problem . . . . II-18
Graphical Solution of a LP Models . . . . . II-26
Classification and Properties of Solutions
(the way to the Simplex Method) . II-41
Extreme-Point Solutions & Basic Feasible Solutions II-44
An Optimal Solution . . . . . II-54
The Simplex Method . . . . . . . II-58
Integer LP Models --- Examples. . . . . . II-71
Non-LP Models --- Examples . . . . . . II-73
Quadratic Programming Models --- Examples . . . II-74
Integer Quadratic Programming Models --- Examples . . II-75
Goal Programming. . . . . . . . II-76
ii
Section III
Section IV
Dynamic Programming . . . . . . . IV-1
Stagecoach Problem . . . . . . IV-2
Knapsack Problem . . . . . . . IV-10
Production and Inventory Scheduling . . . . IV-18
References . . . . . . . . . IV-20
iii
Introduction
Any problem that requires a positive decision to be made can be
classified as an Operations Research (OR), Decision Modeling,
Problem Solving in Business type problem.
Section I
The solution is quite simple for the two-machine problem, but more
difficult for the general M-machine problem.
Each job requires the amount of time on the two machines as given in
the following table:
The following table illustrates the actual flow of jobs through the
machines using the current sequence:
1-2-3-4-5-6-7-8-9-10
From the above table, we see that the idle time on machine 1 is just
the time between the finish of job 10 on machine 2 and the finish of
job 10 on machine 1 which is 94 – 72 = 22.
= 20 + 6 + 0 + 0 + . . . + 0
= 26
1. When all processing times are considered for both machines in the
present example, we see that job 10 has the smallest processing
time on machine 2, so job 10 is placed last in the sequence.
1. 6-3-9-5-8-2-4-1-7-10 or
2. 6-9-5-5-8-2-4-1-7-10 or
3. 6-3-9-5-8-2-4-7-1-10 or
4. 6-9-3-5-8-2-4-7-1-10
All 4 sequences are optimal in the sense that the total time to process
all jobs on the two machines is a minimum among all possible
sequences.
6-3-9-5-8-2-4-1-7-10
With this sequence, the total elapsed time to process all 10 jobs
through the two machines is reduced from 94 to 73 units, a reduction
of 22 percent.
Likewise, the idle time on machines 1 and 2 has been reduced from 22
to 1(i.e., 73-72) and from 26 to 5(i.e., 2+3) respectively.
Press OK
Enter the data from the main table on page I-2. Note that:
o Machine 1 the same as Operation 1
o Machine 2 the same as Operation 2
CDS Method:
Notice that:
o All different methods gave the same Min. Time of 73 units spent
o Do not forget to use “Results/Show Job Sequence” to obtain the
Job Sequence above……
Likewise, if the resource is people who can each perform any one of
several jobs, possibly in different amounts of time, and the measure of
effectiveness is the total time to perform all of the jobs when one and
only one person is “allocated” to one and only one job, then the
problem is classified as an Assignment Problem.
Job 1 Job 2
Person A 2 4 2!
Person B 3 2
Suppose further that three people and three jobs are involved with the
corresponding times given by:
Assignments
A:1 A:1 A:2 A:2 A:3 A:3
B:2 B:3 B:1 B:3 B:1 B:2
3! C:3 C:2 C:3 C:1 C:2 C:1
Total 14 18 22 20 18 12
Effectiveness
Call Routing: Many telephone calls from New York to Los Angeles,
from Houston to Atlanta, etc. How should these calls be routed
through the telephone network?
The list goes on and on. In each case, LP Model involves a linear function
of several Variables to be optimized (maximized or minimized) subject to a
set of Linear Constraints and non-negativity restrictions on the Variables.
Once a problem has been put into LP Model, a procedure (called Simplex
Method) can be used to obtain an Optimal Solution. The only real problem is
to formulate the given problem as a LP Model.
n
Subject to: ∑ aij xj (*) bi for all values of i =1,.., m
j=1
& xj >= 0
where
cj is a known “cost/profit” coefficient of xj
xj is an unknown variable to be determined,
aij is a known constant,
bi is a known constant, and
(*) means >, >=, <, <=, or =.
or, in details:
Optimize Z = c1 X1 + c2 X2 + c3 X3 + . . . + cn Xn
s.to:
a11 X1 + a12 X2 + a13 X3 + . . . + a1n Xn (*) b1
a21 X1 + a22 X2 + a23 X3 + . . . + a2n Xn (*) b2
a31 X1 + a32 X2 + a33 X3 + . . . + a3n Xn (*) b3
...
Am1 X1 + am2 X2 + am3 X3 + . . . + amn Xn (*) bm
&
In addition, cabbage cannot be repeated more than twice during the week,
and each other vegetables cannot be repeated more than 4 times during the
week. A total number of 14 repetitions are required during the week.
How many times should each vegetable be repeated during the next week in
order to minimize cost while satisfying the nutrient and taste requirements?
Subject to
&
all Xj >= 0. ; j = 1, 2, 3, 4, 5, 6
X1 = 4
X2 = 1.7
X4 = 2
X5 = 0
X6 = 4
&
Z = 62.9
Since the values are not all integers, the variables must be restricted to integer values
and the problem can be resolved as follows ( by double-clicking on the “Variable
Type” in the input data table of the WinQSB) :
X1 = 4
X2 = 2
X3 = 4
X4 = 0 !!!! Decision Maker Opinion*
X5 = 4
X6 = 0 !!!!
&
Z = 86
• You can use the “LowerBound” and “UpperBound” in the input data
table of the WinQSB to restrict the values of X4 and X6 above.
X1 = 200
X2 = 250
X3 = 300
&
Z = 9,100
The man-hour’s labor required for one desk in the 3 shops is given as follows:
The profit from the sale of one desk of model A is 1.2 pounds
The profit from the sale of one desk of model B is 2.0 pounds
The profit from the sale of one desk of model C is 1.8 pounds
The profit from the sale of one desk of model D is 4.0 pounds
Model A B C D Capacities
Shop X1 X2 X3 X4
Carpentry 2 3 4 4 6000
Painting 1 2 2 3 4000
Finishing 2 2 3 3 5000
Profit/Unit 1.2 2.0 1.8 4.0
s.to
In general,
n
Maximize Z = ∑ cj Xj
j=1
s.to
n
∑ aij Xj <= bi for all values of i =1, . . ., m
j=1
&
Xj >= 0.
X1 = 0
X3 = 0
&
Z = 5,333.334
Hint:
If this is not a desirable solution, add more constraints (or use the
“LowerBound” and “UpperBound” beside the “Variable Type” in the WinQSB
so that all of desks must be produced but in a different numbers from each type
...
3. The restrictions on the number of Trucks of each type that can be handled
by the Final Assembly Department are given in the following table.
10,000 15,000
s.to
X1 = 2,800
X2 = 0
X4 = 9,000
X5 = 0
&
Z = 3,680,000.
* Use “LowerBound” & “UpperBound” to restrict the values of zero for X’s;
for example, let X2 > 500, X3 > 700, and X5 > 300 and see the result….
Water 2 3 1
Consumption
Crop Water
\ A B C Available in
Farm feddan-inch
1 X1A X1B X1C 150
2 X2A X2B X2C 180
3 X3A X3B X3C 100
Profit/Feddan 400,000 300,000 100,000
&
Xij >= 0; i = 1, 2, 3
j = A, B, C.
Solution Using WinQSB S/W (Linear and Integer Programming--- 9 Variables &
9 Constraints):
X1A = 0 X1B = 40
X2A = 40 X2B = 20
X3A = 30 X3B = 0
X1C = 0
X2C = 0 Decision Making Problem! . ! , ! .
X3C = 0
&
Z = 46,000,000.00 (Alternate Solutions exists…Results/Obtain Alternate
Optimal)
Hint: There is a bug in the program especially when you by mistake write alphabets in
the R.H.S. of the table….taken as zeros…
Profit Table
Product Machine
Type 1 2 3 4
1 5 6 4 3
2 5 4 5 4
3 6 7 2 8
The production rates per hour of the 4 Machines when producing the 3 types of
the Product are given in the following table:
The demand for the 3 types during the next month is expected to be 700, 500,
and 400 units of types 1, 2, and 3 respectively.
The maximum available hours to produce the 3 types during the next
production period on the 4 machines are 90, 75, 90, and 85 hours respectively.
*
Hint:
This problem can be formulated and solved as a Machine Scheduling
Problem. See later . . .
&
Z = 2,062.0240
The use of LP, combined with the Sources of Information, hold out the
promise of greater forecasting reliability than is otherwise attainable.
Here, a LP Model, as one of the series of Process Analysis that are being
developed for the USA Economy is considered [6]
Anyhow, in this Model, one of the Basic Questions that have been asked is:
For this reason, the Model must contain details upon the Manufacture of the
Jp-4 Jet Fuel and the other End-Items.
• The Model neglects the fact that the Transportation Resources may be
limited, and it neglects the implications (suggestions) of New
Investments and of the Inventory Accumulation.
• It was assumed that the reference date for all the calculations is January
1st, 1953.
• Both the Equipment Capacities and the Crude Oil Availabilities are taken
to be a datum at the overall maximum rates estimated for January 1st,
1953 --- since the domestic Crude Oil Availability on this date was 7.465
millions of barrels/calendar day --- slightly in excess of the Crude Oil
charging capacity of 7.285 millions of barrels. Even ignoring the
Possibility of Imports, there would have been enough Domestic Crude
Oil to use up the Crude Charging Facilities available within USA.
• Of the Petroleum Refinery Inputs other than the Crude Oil, most of the
Items are taken to be available at the average rate prevailing between July
1st, 1952 and June 30, 1953. All other inputs (labor, electric power, and
sulpheric acid) are considered to be non-limited and are excluded from
the Investigation.
• Just 25 categories of Crude Oil are considered --- despite the fact that
there are over 300 distinct fields within USA.
Maximize Z = ∑ Cj Xj
j=1
s.to:
n
∑ Aij Xj <= Qi for all values of i =1, . . ., m
j=1
&
Xj >= 0.
where
Aij : the main matrix in this Model. This matrix can be divided into 11 sub-
matrices so that the whole matrix consists of 105 * 205 elements.
At the primary distillation stage, there is a choice of how much of each type
of Crude is to be used. Once this selection is performed, the quantities of each
type of straight-run material (Gases, Naphtha, Gas Oil’s and Residuum)
become determined.
At the conversion step (cracking, refining, alkylation’s, etc), there are choices
as to how much of the straight-run materials will be send directly to blending,
how much to the individual types of conversion units, and how much of the
converted materials sent in turn of other units.
The Model here represents no more than a modest attempt to demonstrate the
feasibility of constructing a Mathematical Programming Model for an Industry
or a single Sector of the National Economy.
By the way, we will state here the experience observed over the last 40
years in Egypt which assures the relying of the country upon the
Mathematical Programming Models in its economic planning:
In the Institute of the National Planning, Cairo, a study [5] on the Crude Oil
was conducted 1n 1960 in order to find the optimum exporting of both Crude
Oil and Final Products. The problem was formulated as an LP Model with
about 60 rows and 200 columns. It was solved for both Optimality Criteria.
0 Fig.(2) X1
X2
Now if we take the two constraints
X1 > 0, X2 > 0 together we get the
shaded area as in Fig.(3). All the points
lying in this area, on the X1–axis, on
the X2–axis satisfy the above two non- 0 Fig.(3) X1
negativity constraints.
Take X1 ≤ 4
This represents the area to the left of the
straight line X1 = 4 as shown in Fig.(4).
All the points (X1, X2) lying in the 0 X1
shaded area and on the straight line
X1 = 4 satisfy the constraint X1 ≤ 4. Fig.(4)
Take X2 ≤ 6
Similarly all the points (X1, X2) lying in X2
the shaded area and on the straight line
X2 = 6 in Fig.(5) satisfy the constraint
X2 ≤ 6
0 X1
fig. (5)
Fig.(5)
Fig.(6)
X1 ≤4
X2 ≤6
3X1 + 2X2 ≤ 18 o a X1
Fig.(7)
& X1 ≥ 0 , X2 ≥0.
All such points form what we call the set of feasible solution for the giv-
en example. This set contains an infinite number of solutions.
The points: o ≡ (X1 = 0, X2=0) , a ≡ (X1 = 4, X2=0)
b ≡ (X1 = 4, X2=3), c ≡ ( X1 = 2, X2=6)
d ≡ (X1 = 0, X2=6)
are the corners of the polygon o a b c d and are called the extreme-point
solutions.
X2
Xd2 c
o g a X1
Fig.(8)
(1) The set of feasible solution for a system of structural and non-
negativity constraints is the solutions that satisfy all these con-
straints.
s.to X1 + X2 ≥ 3
X1 – X2 ≤ 1
X2 ≤ 2
& X1 ≥ 0, X2 ≥ 0
The non-negativity constraints X1 ≥ 0, X2 ≥ 0 identify the positive qua-
drant of the plane.
X2
g aa c
o
f Fig.(9) X1
d
b
o a X1
f
Fig.(10)
If fg is shifted parallel to itself, the last point of contact with the polygon
oabcd is the point c. Thus the optimal solution is X1 = 16, X2 = 10 and
the corresponding value of the objective function f(X) = 4*16-2*10 = 44
o a
f X1
Fig.(11)
In this example the polygon oabcd represents the set of feasible solutions
and the objective function has the same slope as third structural con-
straint. Then fg will be parallel to bc. Hence, on shifting fg parallel to it-
self, it will coincide with bc. Consequently any point on the boundary
line bc will be an optimal solution with the same maximum value for the
objective function. In such case we have multiple solutions. In other
words the optimal solutions are :
b = (X1 = 4 , X2 = 3) ,
c = (X1 = 2 , X2 = 6) ,
and any point lying on bc between b & c. The value of the objective
function will be 18 at all these points.
Note: In usual two-dimension linear programming problems, the set of
feasible solutions takes the form of a polygon as shown in the previous
examples. However, in some cases this set may take other forms. This
will be shown in the following examples.
X2
o X1
f a d
Fig.(12)
The set of feasible solutions in this example will be all the points lying on
the segment ce and the extreme-point solutions are represented by the
points c & e.
If fg – the direction of the objective function – is shifted parallel to itself,
it will first meet ce at the point c.
Thus the point c ≡ (X1 = 0, X2 = 5) gives the optimal solution and the
value of the objective function at this point is f(X) = 2*0 + 5 = 5
X2
a
g
o Fig.(13) X1
f
a
b
g
o Fig.(14) X1
f
Models Available
hours
Process A B
I 2 1 20
II 2 3 30
Profit / Unit 10 20
X2 c
g
o a
f X1
Fig.(15)
Problem Solving & Decision Making Using Computer
(Selected Real World Problems) II - 39 ElDaoushy
The optimal solution is X1 = 7.5
X2 = 5.0
and the corresponding value of the objective function is
f(X) = 10*7.5 + 20*5.0 = 175
Notice that the variables must be of integer values. Solve this problem
with variables of integer values.
Remark:
The graphical method for solving linear programming problem is
limited to the cases where there are three or less variables. However
the solution by the graphical method gives an intuitive sight into the
fact that the Linear Programming Problems usually have:
From the examples given in the last section, we have seen that a LP prob-
lem consists of two parts:
(i) Finding the solutions that satisfy the constraints, and
(ii) Selecting from these solutions the one (or more) that optimizes the
objective function.
Also, we noticed that the optimal solution is always one of the extreme-
point solutions. Thus, we need to distinguish between the three types of
solutions that arise in a LP problem namely:
(a) Feasible solutions,
(b) Extreme-point solutions (or basic feasible solutions), and
(c) Optimal solutions.
In the following sections we are going to discuss each type in some detail.
Feasible Solutions
A feasible solution is defined as the values of the decision variables that
satisfy both the structural and non-negativity constraints. Mathematically,
it is the values of Xj that satisfy the structural constraints:
n
∑a
j =1
ij x j ≤ bi ; i = 1,2,......,m
g
As an example of a non-convex polygon is the h
star- shaped area in Fig.(2). If we choose any two
points inside it g & h, it is not necessary that the
line segment gh will lie totally inside the area.
Fig(2)
Therefore, we need to check every solution against all the constraints not
used in reaching this solution.
Take X1=0, X2=0 and substitute in (5), (6), (7) we have X3=4,
X4 =6, X5 =18.
X1 = 0, X2 = 0 X2 = 0 , X3 = 0
o≡ a≡
X3 = 4, X4 = 6 , X5 = 16 X1 = 4 , X4 = 6 , X5 = 6
X3 = 0, X5 = 0 X4 = 0 , X5 = 0
b≡ c≡
X3 = 4, X2 = 3 , X4 = 3 X1 = 2 , X2 = 6 , X3 = 2
X1 = 0, X4 = 0
d≡
X2 = 6, X3 = 4, X5 = 6
(i) No more than m variables are non-zeros (i.e. at least n-m va-
riables are zeros)
(ii) The solution in terms of non-zero variables is unique (since n-m
variables are zeros, then we are left with m variables in m equa-
tions)
X1 ≤4
X2 ≤6
3X1 + 2X2 ≤ 18
& X1 ≥ 0, X2 ≥ 0.
(1) The solution where the slack variables are selected as basic va-
riables is called an initial basic feasible solution.
In our example this is represented by the origin "o".
(2) When we try to get one basic feasible solution from another, one of
the basic variables becomes non-basic.
For example going from "o" to "a", the non-basic variable X1 becomes
basic and X3 becomes non-basic.
An Optimal Solution
An optimal solution is a basic feasible solution that also op-
timizes the value of the linear objective function. Mathemat-
ically, an optimal solution is a set of values of the unknowns
denoted by the n-component column vector X which satisfies
AX ≤ P0 and X ≥ 0 and at the same time optimizes the value
of the objective function f(X) = CX .
o ≡ ( X1 = 0, X2 = 0),
a ≡ ( X1 = 4, X2 = 0),
b ≡ ( X1 = 4, X2 = 3),
c ≡ ( X1 = 2, X2 = 6), and
d ≡ ( X1 = 0, X2 = 6),
Thus at the point c, the objective function attains its maximum value.
The optimal solution is:
X1 =2, X2 = 6 & f(X) = 36
which agrees with the result of the graphical method (mentioned before).
3X1 - 2X2 + X3 = 12
X1 - 5X2 +X4 = 6
-X1 + 2X2 +X5 = 18
Then following the second approach, the basic feasible solutions are:
(X1 = 0 , X2 = 0 )
(X1 = 2 , X2 = 0 )
(X1 = 56/13 , X2 = 6/13 )
(X1 = 8, X2 = 6 )
(X1 = 2 , X2 = 2 )
Substituting in the objective function, the corresponding values are
0, 10, 134/13, 28, -4.
Thus the optimal solution is:
X1 = 8, X2 = 6 & f(X) = 28
Going from one basic feasible solution to another, one of the non-
basic variables becomes basic and one of the basic variables be-
comes non-basic.
3- Among these basic feasible solutions, the one which optimizes the
objective function is the optimal solution. We may have more than
one optimal solution.
Comment:
Even, the number of basic feasible solution is finite, it may be so
large that it would be unpractical to calculate all of them. Dantzing
succeeded in developing an outstanding technique called "Simplex"
method.
This simplex method makes it unnecessary to cover all the basic feas-
ible solutions, because it always leads to a better basic feasible solu-
tion until the optimal solution is obtained. This method will be dis-
cussed in the next section.
Optimize Z = ∑ cj xj
j=1
s.to
n
∑ aij xj (>=,=,<= ) bi ; bi >= 0 for all values of i =1, . . , m
j=1
&
all xj >= 0.
Optimize Z = ∑ cj xj
j=1
s.to
n
∑ aij xj = bi for all values of i =1, . . ., m
j=1
&
all xj >= 0.
which includes:
o slack variables that have been added to the left side of each
<= constraint,
If the original constraint was a <= constraint, the slack variable in the
corresponding equation will satisfy the condition just stated. Likewise,
the artificial (surplus) variables added to the >= constraints and
equalities satisfy the condition for each of the remaining equations in the
equivalent model.
These slack and artificial variables are the basic variables in the
initial basic feasible solution of the equivalent problem.
The solution to the LP model starts with an initial basic feasible solution
using slack and artificial variables. Then it moves to a new better basic
feasible solution by means of replacing one of the basic variables with a
non-basic variable. This non-basic variable is called the entering variable
and is selected according to its potential contribution to the improvement
of the objective function.
This process will stop when one of the following three cases is
reached:
s.to
X1 + 2X2 + X3 + X4 = 3
X1 - X2 + 2X3 + X4 = 4
X1 + X2 - X3 - X4 = -1
&
Xj >= 0.
X1 = 1,
X2 = 0,
X3 = 1,
X4 = 1, and
Z=8
Hint:
The 3rd constraint can be entered as it is, or converted to the following
one:
-X1 - X2 + X3 + X4 = 1
The Red Tomato Company operates two plants for canning their tomatoes and
three warehouses for storing the finished products until they are purchased by
sellers.
The company wants to arrange its shipments from the plants to the warehouses
so that the requirements of the warehouses are met and so that the shipping
costs are kept at a minimum.
The schedule below represents the shipping cost from plant to warehouse:
Warehouse
A B C
Plant I $.25 $.17 $.18
Plant II $.25 $.18 $.14
Each week, plant I can produce up to 850 cases and plant II can produce up to
650 cases of tomatoes.
Also, each week warehouse A requires 300 cases, warehouse B, 400 cases, and
warehouse C, 500 cases.
If the number of cases shipped from Plant I to warehouse A,B, and C are
represented by X1, X2, X3; and if the number of cases shipped from Plant II to
warehouse A,B, and C are represented by X2, X3, X4, the above data can be
represented by the table:
Warehouse
A B C Supply
Plant I X1 X2 X3 850
Plant II X4 X5 X6 650
Total 300 400 500
Demand
s.to:
X1 + X2 + X3 <= 850
X4 + X5 + X6 <= 650
X1 + X4 = 300
X2 + X5 = 400
X3 + X6 = 500
&
Xj >= 0
Hint:
s.to
X1 + X2 + X3 - 5X4 = 4
X1 - X2 + 3X3 + X4 = 0
&
Xj >= 0.
Unbound Solution. . . .
Hint:
Change the Objective Function to “Minimize” from “Edit/Objective
Function Criterion”, the solution becomes:
X1 = 2,
X2 = 2,
X3 = 0,
X4 = 0, and
Assume that a small company produces two types of paint (paint X1 and paint
X2).
Paint X1 produces a net profit of $6 per hundred gallons and paint X2 gives $8
per hundred gallons.
The amount of paint of either type produced is limited by both raw material
availability and labor hours.
Assume that both paints use the same scarce raw material ,however, paint X1
requires one hour of labor and only one unit of the raw material per hundred
gallons produced while paint X2 requires 4 hours of labor and one unit of the
raw material per hundred gallons produced.
Finally, there are 20 units of raw material and 40 hours of labor available each
week.
s.to
X1 + X2 <= 20 . . . . material constraint
X1 + 4X2 < = 40 . . . . labor constraint
&
Xj >= 0.
Z = 133.333
s.to
2X1 + X2 + X3 <= 2
X1 - 2X2 + 3X3 <= 5
2X1 +2X2 + X3 < = 6
&
Xj >= 0.
X1 = 0.0,
X2 = 0.2,
X3 = 1.8, and
Z = 5.6.
s.to
X1 + 2X2 + X3 <= 430
3X1 + 2X3 <= 460
X1 + 4X2 < = 420
&
Xj >= 0.
X1 = 0,
X2 = 100,
X3 = 230, and
Z = 1350.
Min. Z= - X3 - X4 - X5 + 11
s.to
X1 + X3 - X4 +2X5 = 2
X2 - X3 + 2X4 - X5 = 1
&
Xj >= 0.
Hint:
Solve without the constant 11 found in the objective function and add it
to the result of Z after the solution has been obtained. Also, you can X6 to
the Objective Function with coefficient 11 and to the Constraints with
zero coefficients……
X1 = 0,
X2 = 0,
X3 = 5,
X4 = 3,
X5 = 0, and Z = -8
Z = -8 + 11 = 3.
X1 = 0, !!!
X2 = 0, ! ! ! Decision Maker . . . .
X3 = 24, and
Z = 336.
Hint: if you change the sign of the 3rd constraint to =, the result will be:
X1 = 0, X2 = 16, X3 = 16, and Z = 320.
Hint:
For Integer LP Problems, just choose the radio-box named
“Nonnegative integer” in the “LP-ILP Problem Specification –
Default Variable Type” window.
Decision Solution
Variable Value
X1 2.0000
X2 4.0000
s.to
X1 + X2 + X3 + X4 <= 8
2X1 + X2 +3X3 <= 12
5X2 + X3 + 3X4 <= 6
X1 <= 1
X2 <= 1
X3 <= 4
X4 <= 2
&
Xj >= 0 and integer
1 X1 1.0000
2 X2 0.0000
3 X3 3.0000
4 X4 1.0000
s.to:
X12 + X22 =4
X1 + X2 <1
X1 >= -5
X1 <= 5
X2 >= -5
X2 <= 5
Hint: use the exponential function exp() to represent the item appeared in the
of. Use the “Lower & Upper bounds” of X1 & X2 instead of the last 4
constraints.
[Solution: X1 = -0.8068, X2 = 1.8295, & Z = -0.6127]
s.to:
X1 >= 0
X1 <= 100
X2 >= 0
X2 <= 200
X3 >= 0
X3 <= 300
Hint: Use the power square symbol shown in the example of the WinQSB to
represent items appeared in the of. Use the “Lower & Upper bounds” of
X1, X2, and X3 instead of the 6 constraints.
[Solution: X1 = 0, X2 = 0, X3 = 0.4982, & Z = -0.2500]
s.to:
&
This problem can be illustrated using the option: “Spreadsheet Matrix Form”
as follows:
The solution usually occurs when the deviations from the stated goals
have been minimized.
Let us look back at the company which makes 2 products (Tables &
Chairs) that must be processed through Assembly & Finishing
Departments.
The Profit is $8/table & $6/chair. What was the best possible
combination of producing Tables & Chairs to maximize the
Company Profit?
Maximize Z = 8T + 6C
s.to:
4T + 2C <= 60
2T + 4C <= 48
& T, C >= 0.
In this case, the three goals can not be added because dollars and units
do not add; in addition, deviating from the optimal solution of 12 Tables
and 6 Chairs will reduce Profit from the $132 optimum; thus we see
that goals 2 and 3 conflict with goal 1.
Managers who want to use GP only have to say which goal they consider
more important than another; they do not have to say how much more
important they consider it.
With only a single-goal (say profit), we could just as easily solve the
problem using LP, but a single-goal model is a good starting point for
understanding GP.
Suppose that the company sets its profit goal at $140 (it was $132 as
an optimal LP).
For this reason, both a slack variable and a surplus variable are needed.
(for Slack & Surplus Variable, refer to page II – 58…………………….)
Thus, our Goal becomes:
where
At this point, the new equation is used to define the new variables.
Hence it enters the Problem as a constraint not a Goal (Objective
Function).
This problem would be ready for solution by the Simplex Method. So,
Solving by WinQSB, we have:
T = 12,
C = 6,
Du = 8.00,
Do = 0.00
&
G1 = 8.00.
The actual answer turns out to be 12 Tables and 6 Chairs (the same as in
the LP solution), but the value of the objective function is $8 (the
amount by which we underachieved our $140 goal).
Of course, we knew that $132 was the maximum profit earnable with
these constraints, so missing $140 by $8 was expected.
Since these goals are equally ranked, a $1 deviation from the Profit
Target is just as important (in the GP Model) as a deviation of 1Table.
Thus, the Objective Function and Constraints for the Problem with
Multiple Equality Ranked Goals becomes:
Notice also that, Using Integer Variables for T & C, the solution will
be:
T = 13
C=0
D up = 0 Dop = 4
D ut = 0 Dot = 3
&
G1 = 0
s.to:
X1 + X2 ≤ 100 (Labor constraint) (1).
Min:G1 1 1 1 1 1 1
s.to:
C1 1 1 1 -1 = 100
C2 4 1 1 -1 = 200
C3 2 3 1 -1 = 110
LB 0 0 0 0 0 0 0 0
UB M M M M M M M M
VT C C C C C C C C
Solution:
All the Goals are now achieved with Profits = 266.7[2X1 +3X2]
instead of 300.
Min:G1 2 1 1 1 1 0
C1 1 1 1 -1 = 100
C2 4 1 1 -1 = 200
C3 2 3 1 -1 = 110
LB 0 0 0 0 0 0 0 0
UB M M M M M M M M
VT C C C C C C C C
Solution:
1 G1 X1 33.33
2 G1 X2 66.67
3 G1 Dlu 0
4 G1 Dlo 0
5 G1 Dsu 0
6 G1 Dso 0
7 G1 Dpu 0
8 G1 Dpo 156.67
Note that this is different from weighting of Goals and cannot be transformed
into a standard Linear Programming Problem. However, it can be solved by a
straightforward Modification of the Simplex Algorithm.
[3 Goals, 8 Variables, and 7 Constraints --- See the Model on next page]
Min:G1 1 1
Min:G2 1 1
Min:G3 1 1
C1 1 1 1 -1 = 100
C2 4 1 1 -1 = 200
C3 2 3 1 -1 = 110
C4 1 = 0
C5 1 = 0
C6 1 = 0
C7 1 = 0
Lower Bound: … 0 …
Upper Bound: … M …
Variable Type: … Continuous -
Solution:
1 G1 X1 33.33
2 G1 X2 66.67
3 G1 Dsu 0
4 G1 Dso 0
5 G1 Dlu 0
6 G1 Dlo 0
7 G1 Dpu 0
8 G1 Dpo 156.67
9 G2 X1 33.33
10 G2 X2 66.67
11 G2 Dsu 0
12 G2 Dso 0
13 G2 Dlu 0
14 G2 Dlo 0
15 G2 Dpu 0
16 G2 Dpo 156.67
17 G3 X1 33.33
18 G3 X2 66.67
19 G3 Dsu 0
20 G3 Dso 0
21 G3 Dlu 0
22 G3 Dlo 0
23 G3 Dpu 0
24 G3 Dpo 156.67
Minimize G1 = 3B + 2C,
Maximize G2 = 10A + 9B + 8C
s.to:
A+ B >= 30
B + C >= 50
A + B + C <= 80
3A + 2C <= 120
&
A = 16,
B = 14,
C = 36
&
G1 = 114,
G2 = 574.
Min. c(j)
Max. c(j)
1 G1 A 16.00
2 G1 B 14.00
3 G1 C 36.00
4 G2 A 16.00
5 G2 B 14.00
6 G2 C 36.00
Network Modeling
An Oil Company (for example) has Oil Fields in Saudi Arabia and Borneo*,
Refineries in Japan and Australia, and Customers in the US and New Zealand.
The fields produce different qualities of Oil, which is refined and combined into
different grades of gasoline.
What Raw Oil should be shipped to which Refinery? How much of each type of
Gasoline should each Refinery produce for Customers at US & New Zealand?
http://www.rpi.edu/~mitchj/math1900/lp/node4.html
John E Mitchell
2000-04-11
• Borneo is the 3rd largest Island in the world. This Island is divided between
Indonesia, Malaysia, and Brunei.
The commodity costs a certain amount to ship 1 unit from a given plant
to a given warehouse.
Each plant has a certain capacity for producing the commodity (Capacity
or Supply).
D1
S1 W
A
D2
R
P S2
E
L H
A O
N Si xij/cij Dj U
T S
S E
S
Sm Dn
Capacity/Supply Demand/Requirements
s.to n
∑ Xij <= Si for all values of i = 1, 2, . . . , m (1)
j
∑ ∑ Xij <= ∑ Si
i j i
∑ ∑ Xij >= ∑ Dj
j i j
∑ Si >= ∑ Dj
i j
∑ Si = ∑ Dj
i j
s.to
∑ Xij = Si for all values of i = 1, 2, . . . , m (1)
j
&
all Xij >= 0
where
∑ Si = ∑ Dj
i j
The value 2.2 represents the cost of shipping one car from plant (source)
2 to dealer (warehouse) 3.
5
∑ X2j = 400 3 Constraints
j=1
5
∑ X3j = 100
j=1
5 Constraints
3 3
∑ Xi4= 150 ∑ Xi5 = 200
i=1 i=1
& Z = 1,135
A Car Rental Agency serving seven cities has a surplus of cars in three cities
(labeled W1, W2, and W3) and a need for cars in four cities (labeled M1, M2,
M3, and M4).
The excess of cars in W1, W2, and W3 is 20, 20, and 32 respectively.
The needs for cars at M1, M2, M3, and M4 are 16, 20, 20, and 16 respectively.
The table of distances between the cities and the circumference conditions
(denoted by M) are as follows:
M1 M2 M3 M4 Excess
Cars
W1 17 23 20 M 20
W2 23 15 23 20 20
W3 25 M 13 21 32
Needs 16 20 20 16
For Cars
The two occurrences of M’s in the cells indicate that it is not possible to
transport cars from W1 to M4 or from W3 to M2 because of (for example) road-
repair work. Thus, M denotes an extremely large distance.
How should the Agency transport its Cars to satisfy the Demands and
Minimize the Total Distance driven?
Find the optimal solution for the Transportation Problem. Negative costs
might indicate some sort of bonus, or net profit, realized by the shipping from
the corresponding Origins to the corresponding Destinations.
Destination
Origin 1 2 3 4 5 6 Supply
1 10 4 7 2 3 4 15
2 1 1 13 8 7 6 10
3 2 8 -1 5 1 4 5
4 7 9 2 7 3 2 9
5 3 4 15 7 -2 5 3
Demand 8 7 12 2 3 10 42
s.to
n
∑ Xij = 1 for all values of i
j=1
n
∑ Xij = 1 for all values of j
i=1
Task
Employee 1 2 3 4
1 5 8 8 6
2 4 6 5 8
3 6 10 7 4
4 9 9 7 3
Task
Employee 1 2 3 4
1 1
2 1
3 1
4 1
Hint:
• Use “Edit/Node Names” to change the name of each
node in the table. For example, the default names are:
o From Assignment 1 To Assignee 1, Assignee 2, . . .
From Assignment 2 To Assignee 1, Assignee 2, . . .
etc. . .
Solve the Assignment Problem for which the cost matrix is:
Jobs
1 2 3 4 5
Person
1 5 3 4 7 1
2 2 3 7 6 5
3 4 1 5 2 4
4 6 8 1 2 3
5 4 2 5 7 1
Jobs
Men 1 2 3 4 5 Available
1 2 9 2 7 1 1
2 6 8 7 6 1 1
3 4 6 5 3 1 1
4 4 2 7 3 1 1
5 5 3 9 5 1 1
Required 1 1 1 1 1 5
There are two methods we can use, Prim or Kruskal. The Kruskal
Algorithm is better for small hand-computed networks but inefficient for
larger networks, so let us use the Prim Method, which works on
networks of all sizes.
4 6
1,000
300
200
1. Water 3
100 500
Line Taps
ON 600 5 800
400
1,100
7
2 900
To Node
From
Node 1 2 3 4 5 6 7
1 0 1,100 100 300 600 1,000 400
2 1,100 0 M M M M 900
3 100 M 0 M 500 M M
4 300 M M 0 M 700 M
5 600 M 500 M 0 200 M
6 1,000 M M 700 200 0 800
7 400 900 M M M 800 0
Step 2 :
Select any Node to begin the Algorithm; indicate that this Node is
connected by some appropriate mark (we shall use an X) and
delete the column headed by this node. Now look at following
table:
Step 4 : Mark the newly connected node with an X and delete the column
headed by this node.
Step 5 : Repeat steps 3 and 4 until all the nodes have been connected.
The following figure shows the optimum answer from the previous
table:
4 6
300
200
1. Water 3
100 500
line taps on
5
400
7
2 900
In the figure, the closest routes are those that were marked when we
finished the final step in the marked values in the previous table; in this
case 2400 units of length of Water Line will be required to connect all the
Homes in Alan’s Development.
Hint:
B 15 E
20 H
10 18 12 29
-2 37
24
A 27 D
22 G 9
-10 35 11 -5
36
26 K
C 4 F
From
A B C D E F G H K
To
A 10 -10 27
B 10 18 -2 15
C -10 18 36 4
D 27 -2 36 12 35 22
E 15 12 22 29 20
F 4 35 22 11 26
G 22 29 11 37 -5
H 20 37 9
K 26 -5 9
B 15 E
20 H
10
18 12 29
-2 37
24
A 27 D
22 G 9
-10 35 11 -5
36
26 K
C 4 F
Terminal A is the computer itself and phone cables must be wired along some
of the indicated branches in order that there is a connected path from every
terminal back to A.
The numbers along the arcs represent the costs (in 100s of dollars) of installing
the lines between terminals.
Since operating costs are very low, the company would like to find the branches
that should be installed in order to minimize total installation costs.
B
8
2 F
2
5 4
A 5 C 1
G
2
6
1
3 E
3
D
From
A B C D E F G
To
A 2 5 3
B 2 2 8
C 5 2 1 2 5
D 3 1 3
E 2 3 1 6
F 8 5 1 4
G 6 4
A B 2
B C 2
C D 1
C E 2
E F 1
F G 4
B
8
2 F
2 4
5
A 5 C 1
2 G
6
1
3 E
3
D
The city park management needs to determine under which roads telephone
lines should be installed to connect all stations with a minimum total length of
lines.
Using the data given the figure, find the shortest spanning tree (spanning tree is
defined as a connected subgraph of a network G which contains the same nodes
as G but contains no loops)
A
7 T
5
2 2 D
4
B
O 5
7
1
1 3
4
C 4 E
From
To O A B C D E T
O 2 5 4
A 2 2 7
B 5 2 1 4 3
C 4 1 4
D 7 4 1 5
E 3 4 1 7
T 5 7
A
7 T
5
D
2 2
4
B
O 5
7
1
1 3
4
C 4 E
14 9
1 4 8
18
15 12
5 7 13 3
11 10
6 6
3
2 16 4
17 7
2 8 5
From
To 1 2 3 4 5 6 7 8
1 6 5 14 18
2 6 2 8
3 5 2 11 16
4 14 11 7 15 10 9
5 18 8 16 7 4 17 12
6 15 4 13
7 10 17 3
8 9 12 13 3
14 9
1 4 8
18
15 12
5 7 13 3
11 10
6 6
3
2 16 4
17 7
2 8 5
Our case study has two separate Networks. One for the Crude
Oil, and the other for Exporting and Consuming Processed Oil.
For the first Network, the following table represents the distances
(in km) between the different Nodes which represent the Crude
Oil Wells knowing that the Refinery Plant is at Suez City and:
150 60
165
160
2
3
4
190
210
240
5 265
6
7
8 9
325
10
Node10 325 300 265 175 150 165 110 150 115 85
Suez Node1 25
Node1 Node2 30
Node2 Node4 55
Node3 Node5 25
Node4 Node3 25
Node4 Node6 25
Node5 Node7 25
Node6 Node8 25
Node6 Node9 30
Node9 Node10 85
Node Name
A Mostorod
B Cairo
C Helwan
D Tanta
E Alexandria
From
\To Suez A B C D E
Suez 120 125 160 180 290
A 120 15 45 80 180
B 125 15 30 90 185
C 160 45 30 120 210
D 180 80 90 120 105
E 290 180 185 210 105
Problem Formulation:
N
∑ xij = 1 ; i = 1, 2, . . , N . . . . (2)
j=1
A great deal of research effort has been put forth in the past years to
solve the general Traveling Salesperson Problem.
Algorithms that find the exact optimal solution are still limited to fewer
than 100 towns. Algorithms that will find the exact solution for large
problems are still very much in need………..
Collecting Coins
An old Application of the TSP is to Schedule the Collection of
Coins from Payphones throughout a given Region. A modified
version of Concorde's Chained Lin-Kernighan heuristic was used
to solve a variety of Coin Collection Problems. The modifications
were needed to handle 1-way Streets and other features of City-
Travel that make the assumption that the Cost of Travel from x
to y is the same as from y to x unrealistic in this scenario.
(Contact: [email protected] )
Touring Airports
Concorde is currently being incorporated into the Worldwide
Airport Path Finder web site to find Shortest Routes through
selections of Airports in the World. The author of the site writes
that users of the path-finding tools are equally split between real
pilots and those using flight simulators. (Contact:
[email protected])
Power Cables
Modules from Concorde were used to locate Cables to Deliver
Power to Electronic Devices associated with Fiber Optic
Connections to Homes. Some general aspects of this Problem
Area are discussed in the paper "Powering the Last Mile: An
Alternative to Powering FITL". (Contact:
[email protected] )
From
A B C D
To
A 4 6 10
B 4 7 10
C 6 7 5
D 10 10 5
From
LA DEV HOU DAL CMH NY
To
LA 100 150 300 500
DEV 100 160 150 300
HOU 150 160 100 260 290
DAL 150 100 240 360
CMH 300 300 260 240 200
NY 500 290 360 200
Consider the following Traveling Salesperson Problem with the cost data:
To City
1 2 3 4 5
From City
1 M 20 4 10 25
2 20 M 5 30 10
3 4 5 M 6 6
4 10 25 6 M 20
5 35 10 6 20 M
Notice that this problem is not a “Symmetric Arc Coefficients – i.e., not
“both Ways same Cost”. . . [See later for the same problem with Symmetric
Arc Coefficients. . . .]
Solve:
To City
1 2 3 4 5
From City
1 M 20 4 10 25
2 20 M 5 30 10
3 4 5 M 6 6
4 10 30 6 M 20
5 25 10 6 20 M
To A B C D
-------------------------------------------
From A - 1 4 5
B 3 - 1 2
C 2 4 - 3
D 5 2 6 -
Find the shortest circuit in the above network which meets all nodes.
Many Problems fall into the general category of Allocation Problems, so a single
DP Algorithm could be used to solve Problems as Assigning Men to Jobs. On the
other hand, a different Algorithm or Formulation of Equations would be needed to
solve Equipment Replacement Problems.
o Stagecoach,
o Knapsack, and
Stagecoach Problem: Find the Shortest Route from any Node to a Destination.
The Decision we make at each Stage influences not only the next Stage but also
every Stage to the end of the Problem.
Dynamic Programming starts with the Last Stage of the Problem and
works backward toward the First Stage, making Optimal Decisions at each
Stage of the Problem.
Whereas LP has standard ways to formulate the Problems and solve them,
there is no such “Standard Approach” in DP. It is, instead, sort of a general
way of solving Large and Complex Problems by breaking them down into a
series of Smaller Problems which are more easily solved.
It is necessary to know when a Problem might be solved by using DP and how that
Solution should be Approached.
The map with the Alternative-Routes between the Origin (Atlanta --- node 1) and
the Destination (St. Louis --- node 10) has been shown in the following figure.
The arrows (or branches, as they are called) represent highways between the
Nodes, each with its mileage indicated:
2 300 6
200
275 200
100 9
400 100
1 4 5 10
150 175
250 150
175
8
275
200 125
3 350 7
Highway Network
The Problem is to find the Shortest Route from Atlanta to St. Louis.
2 300 6
200
275 200
100 9
400 100
1 4 5 10
150 175
250 150
175
275 8
200 125
3 350 7
Stage 1:
Look at Node 8. There is only one route from Node 8 to St. Louis (Node 10). This
is the Shortest-Route (the distance is 150 miles).
Look now at Node 9. Here also one Route to Node 10 (the distance is 100 miles).
Thus we have found the Optimal-Route from each input Node (8 and 9) to an
output Node (10). The solution of Stage 1 is shown on the following partial
network:
Stage 1
100
9
100
10 St. Louis
150
150
8
The Node we begin with at any Stage is not important, so let us start with Node 7.
Only one output Node for Node 7 (which is Node 8). Therefore the Shortest
Distance from Node 7 to St. Louis is 275 miles (125+150).
For Node 6, the Shortest-Distance from Node 6 to St. Louis is 300 miles
(200+100).
For Node 5; there are two output Nodes for Node 5 (Nodes 8 and 9).
Therefore, the choice of an optimal Route between Node 5 and
St. Louis is either 500 miles (400+100) or 400 miles (250+150).
Route 5-8-10 is the Optimal one.
Stage 2
300
6
100
200
9
400
400 100
5 10 St. Louis
150
250 150
275 8
125
7
Note: we have solved Stage 2 Problem by using the output from Stage
1 Problem (the Optimum Distances 100 and 150 miles). We did
not have to measure distances all the way from Stage 2 Nodes to
St. Louis to find the Shortest Route, only from Stage 2 Nodes to
Stage 1 Nodes.
Start with Node 2. Using the Optimum Answers for Nodes 6 and 5 from Stage 2
(300 and 400 respectively), we evaluate Routes 2-6 and 2-5 and choose 2-6 (300
+300 < 275+400).
Looking at Node 4, there are 3 choices. The Optimum-Route is 4-6 (500 < 575 or
550).
Stage 3
300
600
2 300 6
100
200
275 200
9
500 400
400 100
4 5 10
175
150
250 150
600 275 8
275
200 125
3 350 7
There is only one input Node in this Stage (Node 1). We have three choices (route
1-2, 1-4, or 1-3). Using the output of Stage 3, we choose route 1-4 (650 < either
700 or 775).
Stage 4
600 300
2 300 6
100
200
275 200
100 9
650 500 400
400 100
1 4 175 5 10
150
150
250 150
175
600 275 8
275
200 125
3 350 7
Combining answers from the four Stages to find the Shortest Route.
Now let us go through the Network from Stage 4 to Stage 1 and pick the best
decision at each Stage.
You can see that the Shortest Route between Atlanta and St. Louis is 1-
4-6-9-10 with a Total Distance of 650 miles.
There are three Types of Problems that can be solved with this S/W:
From\To Node Node Node Node Node Node Node Node Node Node
1 2 3 4 5 6 7 8 9 10
Node1 100 175 150
Node2 275 300
Node3 200 350
Node4 175 200 275
Node5 250 400
Node6 200
Node7 125
Node8 150
Node9 100
Node10
Hint:
WinQSB enables you to choose any Start and Destination Nodes in the given
map to find the Shortest Route between them.
If you have never heard about this problem, you might be interested in taking a
quick look at the formal definition given below.
Suppose that you have a knapsack and you wish to fill it up with available items
so as to maximize the total value of the items in the knapsack subject to the
weight constraint, requiring that the knapsack not to exceed a prescribed total
weight.
There are several versions to this Problem related to the Availability of Items. In
particular, the 0-1 Version represents a situation where only one item of each type
is available or can be selected. The unbounded case, which we consider here,
assumes that there are n types of Items and that there are infinitely many Items of
each type.
The raw input data for this “Version” consists of the following:
s.to:
w1x1 + w2x2 + ... + wnxn <= W
&
x1,...,xn >= 0 & integer
The weights w1,...,wn of the Items as well as the maximum allowable weight of the
Knapsack, W, are assumed to be non-negative integers.
s.to:
Then, clearly (as they say in the books), the following must be true:
Input Data:
Item Item Units Unit Capacity Return
(Stage) Identification Available Required Function
1 A 5 10 8A
2 B 3 6 10B
3 C 4 3 4C
4 D 2 5 7D
Knapsack Capacity = 20
Hint:
This Problem can be stated as an Integer Linear Programming Problem which gives the same
result as follows:
Max. z = 8A + 10B + 4C + 7D
s.to:
10A + 6B + 3C + 5D = 20
A <= 5
B <= 3
C <= 4 optional part
D <= 2
&
Consider a set of 5 indivisible items, each having the weight and value units given
below:
Item No. Weight Value
1 18 27
2 12 9
3 15 30
4 16 16
5 13 6.5
The problem is to fill a knapsack with these items so as to maximize its total value
without exceeding a total weight of 45 units.
DP Example
Solution
Maximize 27 9 30 16 6.5
C1 18 12 15 16 13 = 45
Variables Type Integer
Solution
1 X1 0
2 X2 0
3 X3 3.0000 (Decision Making Problem...)
4 X4 0
5 X5 0
A climber wishes to go on a camping trip and does not wish to carry more than 60 pounds in
his pack.Unfortunately in laying out his equipment, he finds its total weight to be 90 pounds.
There are 3 objects he wants to take, so in order to decide which combination is best, he
attaches a value to each. Suppose his data looks like this:
Object Value Weight Value/Weight
1 70 40 1.75
2 50 30 1.67
3 30 20 1.5
Knapsack Capacity = 60
One way of getting a feasible solution to the problem is to take as many units as
possible of the most valuable item first (i.e., the one with the largest value/weight
ration), then as many of the second as possible, and so on. If this is done for the
given problem, the solution is:
X1 = 1,
X2 = 0,
X3 = 1 and
Z = 100.
Note that there is an alternative solution with the same objective value for which:
X2 = 2,
X1 = 0, and
X3 = 0.
(Coincide with the WinQSB solution DP & ILP in case of actual values)
The first solution is the largest-ratio solution. The largest-ratio rule gives the
optimum answer quite often.
Knapsack Capacity = 5
Solution
Hint:
The same solution can be found by solving the problem as an ILP Problem with
one constraint….
Let:
P(n): number of units Produced in period n.
D(n): Demand in period n.
H(n): on-Hand inventory at the end of period n.
B(n): Backorder at the end of period n.
Note that you can define the variable cost function as a function of P, H,
and/or B with operations +, -, *, /, ^ (exponentiation), mod, the scientific
function ABS(absolute value),
ATN (arctangent), COS (cosine), EXP (exponential), LOG (natural
logarithm), SIN(sign value), SQR (square root), TAN (tangent), . . . etc.
DP QSB
Stage Period Demand Production Storage Production
Capacity Capacity Setup Cost Cost Function
300 * 5 + 100 * 1
320 * 4 + 0
250 * 3 + 0
350 * 4 + 0
Prof. Yih-Long Chang has a Ph.D. from the University of Texas at Austin, May
1985. Major Field: Operations Management. Supporting Fields: MIS, Management
Science.
Now, he is working as a professor at Dupree College of Management, Georgia
Institute of Technology. Atlanta, Georgia 30332-0520 (404)894-4334