Professional Documents
Culture Documents
管數講義 全 (eng)
管數講義 全 (eng)
- Characteristics of OR :
OR and MS
1
Book Title: introduction to Operations Research
Deterministic Models :
- Integer Programming
Non-linear Programming
- Polynomial Programming
- Birth-Death process
M/M/1 Model
M/M/S Model
G/M/1 Model
G/G/1 Model
2
1. Define the problem of interest and gather relevant data.
3. Develop a computer-based procedure for deriving solutions for the problem from
the model.
6. Implement.
L o n- t ge r pm r o mf i ta x i mo ni z. a t i
- The appropriate objectives
L o n- t ge r cmo ms t i n i mo inz . a t i
- Other factors : Ex. The five parties generally affected by a business firm located in
4) the suppliers; who desire integrity and a reasonable selling price for their
goods; and
5) The government and hence the nation, which desire payment of fair taxes and
3
2.2 constructing a mathematical Model
- A mathematical model is invaluable for abstracting the essence of the subject of
- Four components:
Constraints: 3X1+2X2 ≤ 10
both the objective function and the constraints are all linear functions.
design of radiation therapy that effectively attacks a tumor while minimizing the
4
2.3 Deriving a solution
- Algorithms (iterative solution procedures)
- Software package
- The distinction between optimizing and satisficing reflects the difference between
theory and the realities frequently faced in trying to implement that theory in
practice.
- Samuel Eilon, ”Optimizing is the science of the ultimate; satisficing is the art of
the feasible.”
- Other factors: the cost of study, the disadvantages of delaying its completion.
- Post-optimality analysis
- Sensitivity analysis: to determine which parameters of the model are most critical
5
- One of the first lesson of OR is that it is generally not sufficient to rely solely on
one’s intuition.
- The proper criterion for judging the validity of a model is whether or not it
predicts the relative effect of the alternative courses of action with sufficient
- Problems: The OR team either has not been given all the true facts of the situation
- Retrospective test: this test involves using historical data to reconstruct the past
and then determining how well the model and the resulting solution would have
- This system would include the model, the solution procedure (including post-
2.6 Implementation
- Benefits and KPI ( Key-Performance Index )
6
Ch.3 Introduction to Linear Programming
patterns.
- The objective linear means that all the mathematical functions in this model are
- Simplex method
windows and glass doors. It has three plants. Aluminum frames and hardware are
made in plant 1, wood frames are made in plant 2, and plant 3 is used to produce the
7
Prototype Example ( continued )
Conditions:
1) The percentage of each plant’s production capacity that would be available for
these products.
2) The percentage required by each product for each unit produced per minute.
3 3 2 18
Unit Profit $3 $5
Maximize: Z=3X1+5X2
P la n1 t:1 X1 ≤ 4
P la n2t: 2 X2 ≤ 1 2
P la n3t: 3 X1 + 2 X2 ≤ 1 8
and X1 ≥ 0 , X2 ≥ 0
8
Graphical Solution
X1 = 2 and X2 = 6
- Conclusion:
The Wynder Glass Co. should produce products 1 and 2at the rate of two per
$36/minute.
9
3.2 The Linear Programming Model
Common Terminology for LP:
Prototype Example General Problem
Production capacities of plants Resources
3 plants m resources
Production of products Activities
2products n activities
Production rate of product j ( Xj ) Level of activity j ( Xj )
Profit ( Z ) Overall measure of Performance ( Z )
- Determing this allocation involves choosing the levels of the activities ( the values
of the decision variables ) that achieve the best possible possible value of overall
measure of performance Z.
activities.
10
- aij is the amount of resource i consumed by each unit of activity j.
- aij, bi, and cj are the parameters ( input constraints ) of the LP model.
Other Forms:
Z = C1X1+C2X2+……+CnXn
- Any specification of values for the decision variables(X1 ,X2 ,…,Xn)is called a
11
solution.
- A feasible solution is a solution for which all the constraints are satisfied. EX:
- An infeasible solution is a solution for which at least one constraint is violated. EX:
EX. If the new products had been required to return a net profit of at least $50 per
12
solution, as measured by the value of the objective function in the model.
- An optimal solution is a feasible solution that has the most favorable value of the
objective function.
EX. If the profit per minute produced of product 2 were changed to $2.
- Any problem having multiple optimal solutions will have an infinite number of
them, each with the same optimal value of the objective function.
13
- This occurs only if
(2) the constraints do net prevent improving the value of the objective function (Z)
EX. Deleting the last two constraints 2X2 ≤12 and 3X1+2X2 ≤18
feasible region.
If the problem has multiple optimal solutions, at least two must be CPF
14
A1: Proportionality Assumption:
proportional to the level of the activity Xj, as represented by the CjXj term in the
objective function.
- The contribution of each activity to the left-hand side of each functional constraint
is proportional to the level f the activity Xj, as represented by the aijxj term in the
constraint.
Case 1: If there were start-up costs associated with initiating the production of
Case 2: The slope of the profit function for product 1 keeps increasing as X1 is
Case 3: The slope of the profit function for product 1 keep decreasing as X1 is
Assumptions of LP
A2: Additivity assumption: – cross-product terms.
15
Every function in a LP model is the sum of the individual contributions of the
respective activities.
- If the two products were complementary in some way that increase profit.
- If the two products were competitive in some way that decreased their joint profit.
- Nonlinear Programming
– Integer Programming.
constant.
ionizing radiation through the patient’s body, damaging both cancerous and
16
healthy tissues.
- The goal of the design is to select the combination of beams to be used, and the
- The dose strength at any point in the body is measured is units called kilorads.
Dosage, kilorads
Health anatomy 0.4 0.5 Minimize
Critical tissues 0.3 0.1 ≤ 2.7
Tumor region 0.5 0.5 =6
Center of tumor 0.6 0.4 ≥6
17
Subject to: the average dosage absorption
And X1 ≥ 0 , X2 ≥ 0
Graphical Method:
Conclusion: Thus, the optimal design is to use a total dose at the entry point of
7.5kilorads for beam 1 and 4.5kilorads for beam 2. The total dosage
18
agricultural production for the coming year. The agricultural output of each
kibbutz is limited by both the amount of available irrigable land and the quantity
of water allocated for irrigation by the water commissioner. (Table 3.8). The crops
suited for this region include sugar beets, cotton, and sorghum, and these are the
three being considered for the upcoming season. These crops differ primarily in
their expected net return per acre and their consumption of water. In addition, the
Ministry of Agriculture has set a maximum quota for the total acreage that can be
- Because of the limited water available for irrigation, the SCK will not be able to
use all its irrigable land for planning crops in the upcoming season. To ensure
equity between the three kibbutzim, it has been agreed that every kibbutzim will
plant the same proportion of its available irrigable land. However, any
19
Maximum Water consumption Net Return
Crop Quota(Acres) (Acre Feet / acre) ( $ / Acre)
Sugar beets 600 3 $1,000
Cotton 500 2 $750
Sorghum 325 1 $250
Q: The job facing the Coordinating Technical office is to plan how many acres to
devote to each crop at the respective kibbutzim while satisfying the given restrictions.
- The objective is to maximize the total net return to the SCK as a whole.
Xj = the quantities to be decided upon at the number of acres to devote to each of the
Formulation as a LP Model
Maximix: Z = 1,000(X1+ X2+ X3)+750(X4+ X5+ X6)+250(X7+ X8+ X9)
1. Usable land for each kibbutz: 2. Water allocation for each kibbutz:
20
3. Total acreage for each crop: 4. Equal proportion of land planted:
X1 + X 4 + X 7 X + X5 + X8
X1+ X2+ X3 ≤ 600 = 2
400 600
X2 + X5 + X8 X + X6 + X9
X4+ X5+ X6 ≤ 500 = 3
600 300
X3 + X6 + X9 X + X4 + X7
X7+ X8+ X9 ≤ 325 = 1
300 400
4. → Converted into:
1
X1= 133 , X2=100, X3=25 , X4=100 , X5=250
3
X6=150 , X7=X8=X9=0
are geometric.
21
- Feasible region.
- Corner-point feasible solutions (CPF solutions). EX. ( 0,0 ), ( 0,6 ), ( 2,6 ), ( 4,3 ),
and ( 4,0 )
- The point of intersection are the corner-point solutions of the problem. EX. The
above 8 points.
- For any LP problem with n decision variables, two CPF solutions are adjacent to
each other if they share n-1 constraint boundaries. The two adjacent CPF
solutions are connected by a line segment that lies on these same shared constraint
Optimality Test
Table 4.1: Adjacent CPF solution for Each CPF Solution of the Wynder Glass Co.
Problem.
22
( 2,6 ) ( 4,3 ) and ( 0,6 )
( 4,3 ) ( 4,0 ) and ( 2,6 )
( 4,0 ) ( 0,0 ) and ( 4,3 )
Optimality Test:
- Consider any LP problem that posseses at least one optimal solution. If a CPF
EX. ( 2,6 ) must be optimal. ∵ Z=36 is larger than Z=30 for ( 0,6 ) and Z=27 for
(4,3).
equality constraints.
23
3X1+2X2 ≤ 18
and X1 ≥0 and X2 ≥0
nonbasic variables ( set equal to zero ) and the slack variables to be the
- Optimality Test: The current Basic Feasible ( BF ) solution is optimal if and only if
12, 18 ), Z=0
- Iteration:
Step1: Determine the entering basic variable by selecting the variable with the
24
negative coefficient having the larget absolute value in Eq. (0).
Step2: Determine the leaving basic variable by applying the minimum ratio test.
12
Ex. =6 is the smallest ratio, thus, X4 is the leaving basic variable,
2
Elimination)
25
X4 (3) 0 1 0 0 - 1 2
3
1
3
test2: minimum ratio test: X5 is the leaving basic variable, X1 replace X5, BF is: (
0, 6, 4, 0, 6 ), Z=30
coefficient with the largest absolute value in the Eq. (0) as the entering
basic variable.
EX. If Z = 3X1 + 3X2 => Eq.(0) became Z - 3X1 - 3X2 = 0
Q:How should this tie be broken?
A : Te answer is that the selection between these contenders may be made
arbitrarily.
26
A:Theoretically it does, and in a very critical way.(There possible events can
occur.)
- The basic variable with a value of zero are called degenerate.
- In practice, just break this kind of tie arbitrarily and proceed without
Z - 3 X1 - 5 X2 = 0
S.T.: X1 ≤ 4 =>
X1 + X 3 = 4
and X1 ≥ 0 and X2 ≥0
Table:4.9
Basic Coefficient of: Right
Variable Eq. Z X1 X2 X3 Side Ratio
Z (0) 1 -3 -5 0 0
X3 (1) 0 1 0 1 4 None
- Because the minimum ratio test uses only coefficients that are greater than
zero, there is no ratio to provide a leaving basic variable.
- Interpretation of Table 4.9:
27
The coefficients do not prevent the value of the objective function Z
increasing indefinitely, so the simplex method would stop with the
message that Z is unbounded.
Case 4:Multiple optimal solutions.
EX:If Max: Z = 3X1+2X2
- Every point on the line segment between ( 2,6 ) and ( 4,3 ) is optimal. Thus,
all optimal solution are a weighted average of these two optimal CPF
solution. ( X1, X2 ) = W1‧( 2,6 ) + W2‧( 4,3 ),
Where the weight W1 and W2 are numbers that satisfy the relationship.
W1+W2=1 and W1 ≥0 , W2 ≥0
EX : W1=1/3 and W2=2/3 give (X1,X2)=1/3(2,6)+2/3(4,3)=(10/3,4) —as one
optimal solution
28
Z (0) 1 0 0 0 0 1 18 Yes
Extra X1 (1) 0 1 0 0 -1/3 1/3 2
X3 (2) 0 0 0 1 1/3 -1/3 2
X2 (3) 0 0 1 0 1/2 0 6
Thus, the two optimal BF solutions are ( 4,3,0,6,0 ) and ( 2,6,2,0,0 ) each
yielding Z = 18, Therefore, these two are the only BF solutions that are
optimal, and all other optimal solution are a convex combination of these two.
( X1,X2,X3,X4,X5 ) = W1 ( 2,6,2,0,0 ) + W2 ( 4,3,0,6,0 )
W1+ W2 = 1 , and W1 ≥ 0 , W2 ≥ 0
dummy variable ( called an artificial variable ) into each constraint that needs
one.
full capacity.
- Constructing an artificial problem that has the same optimal solution as the real
29
problem by making two modifications of the real problem.
30
⇒ (0) Z-3X1-5X2 +M X 5 =0 initial basic variables are:
Case1:Equality constraints(cont.)
Z-3X1-5X2+M X 5 =0 Eq.(0)
- Note that the artificial variable X5 is a basic variable ( X 5 >0) in the first two
31
tableaux and a nonbasic variable ( X 5 =0) in the last two.
and Z=36.
- Having nonnegative right-hand sides for all the functional constraints enables
the simplex method to begin, because (after augmenting) these right-hand sides
become the respective values of the initial basic variables, which must satisfy
nonnegative constraints.
32
Case 3: Functional Constraints in ≥ Form
EX. 0.6X1+0.4X2 ≥ 6 (3)
- introduction both a surplus variable X5 (defined as X5=0.6X1+0.4X2-6) and an
artificial variable X6 .
⇒ 0.6X1+0.4X2-X5=6 (X5 ≥0)
⇒ 0.6X1+0.4X2-X5 + X 6 =6 (X5 ≥0, X6 ≥0)
- Here, X5 is called a surplus variable because it subtracts the surplus of the left-
hand side over the right-hand side to convert the inequality constraint to an
equivalent equality constraint.
- Once this conversion is accomplished, the artificial variable is introduced just as
for any equality constraint.
33
- Note that, the coefficients of the artificial variables in the objective function are
+M, instead of –M, because we now are minimizing Z.
Case 4: Minimization
- A simple way of converting any minimization problem to an equivalent
maximization problem is:
n
Minimizing Z= ∑C j X j is equivalent to
j =1
n
Maximizing -Z= ∑( −C j ) X j
j =1
34
Case 4: Minimization (Cont.)
Table 4.12
Basic Coefficient of: Right
Iteratio variable Eq. Z X1 X2 X3 X4 X5 X6 Side
n
Z (0)
- -1.1M+0.4 -0.9M+0.5 0 0 M 0 -12M
1
0 X3 (1) 0 0.3 0.1 1 0 0 0 2.7
X4 (2) 0 0.5 0.5 0 1 0 0 6
X6 (3) 0 0.6 0.4 0 0 -1 1 6
Z (0) - 0 −16 11 11 4 0 M 0 -2.1M-3.6
M+ M −
1 30 30 3 3
1 X1 (1) 0 1 1/3 10/3 0 0 0 9
X4 (2) 0 0 1/3 -5/3 1 0 0 1.5
X6 (3) 0 0 0.2 -2 0 -1 1 0.6
Z (0) - 0 0 −5 7 0 −5 11 8 11 -0.5M-4.7
M + M + M −
1 3 3 3 6 3 6
2 X1 (1) 0 1 0 20/3 0 5/3 -5/3 8
X4 (2) 0 0 0 5/3 1 5/3 -5/3 0.5
X2 (3) 0 0 1 -10 0 -5 5 3
Z (0) - 0 0 0.5 M-1.1 0 M -5.25
1
3 X1 (1) 0 1 0 5 -1 0 0 7.5
X5 (2) 0 0 0 1 0.6 1 -1 0.3
X2 (3) 0 0 1 -5 3 0 0 4.5
Optimal solution: X1=7.5, X2 =4.5, Z=5.25
- Thus, the Big M method can be thought of as having two phases.
Phase1: All the artificial variables are driven to zero in order to reach an initial
BF solution for the real problem.
Phase 2: All artificial variables are kept at zero while the simplex method
generates a sequence of BF solutions leading to an optimal solution.
35
Case 5: No Feasible Solutions
- Fortunately, the artificial-variable technique provides the following signpost to
indicate when this has happened.
- If the original problem has no feasible solutions, then the Big M method yields a
final solution that has at least one artificial variable greater than zero.
Otherwise, they all equal zero.
EX. The Radiation therapy example.
First constraint: 0.3X1+0.1X2 ≤ 2.7 ⇒ 0.3X1+0.1X2 ≤ 1.8
Table 4.16
Basic Coefficient of: Right
Variable Eq Z X1 X2 X3 X4 X5 X6
Side
Z (0) -1 -1.1M+0.4 -0.9M+0.5 0 0 M 0 -12M
0 X3 (1) 0 0.3 0.1 1 0 0 0 1.8
X4 (2) 0 0.5 0.5 0 1 0 0 6
X6 (3) 0 0.6 0.4 0 0 -1 1 6
Z (0) -1 0 −16 11 11 4 0 M 0 -5.4M-2.4
M + M −
30 30 3 3
1 X1 (1) 0 1 1/3 10/3 0 0 0 6
X4 (2) 0 0 1/3 -5/3 1 0 0 3
X6 (3) 0 0 0.2 -2 0 -1 1 2.4
Z (0) -1 0 0 M+0.5 1.6M-1.1 M 0 -0.6M-5.7
2 X1 (1) 0 1 0 5 -1 0 0 3
X2 (2) 0 0 1 -5 3 0 0 9
X6 (3) 0 0 0 -1 -0.6 -1 1 0.6
- Hence, the Big M method normally would be indicating that the optimal solution
is ( 3, 9, 0, 0, 0, 0.6 ). However, since an artificial variable X6 =0.6 > 0, the
real message here is that the problem has no feasible solutions.
36
is in production, and the first decision variable X1 represents the increase in its
be cut back by that amount. Such reductions might be desirable to allow a larger
production rate for the new, more profitable product 2, so negative values should be
- Since the procedure for determining the leaving basic variable requires that all
37
- This constraint can be converted to a nonnegativity constraint by making the
change of variables.
Xj’= Xj-Lj , so Xj’ ≥0
- Thus, Xj’+Lj would be substituted for Xj throughout the model, so that the
redefined decision variable Xj’ cannot be negative.
EX. Suppose that the current production rate for product 1 in the Wyndor Glass Co.
problem is 10.
So X1 ≥0 => X1 ≥-10
Define X1’=X1+10 = the total production rate of product 1 => X1=X1’-
10
38
- Since Xj+ and Xj- can have any nonnegative values, this difference Xj+ - Xj- can
have any value ( positive or negative ), so it is a legitimate substitute for X j in the
model.
EX. Suppose that X1 is redefined as the increase over the current production rate of
10 for product 1 in the Wynder Glass Co. problem.
X1 = X1+ - X1- , where X1+ ≥ 0 , X1- ≥ 0
Max.: Z = 3X1 + 5X2 Max.: Z = 3X1+ - 3X1- + 5X2
S.T. X1 ≤ 4 S.T. X1+ - X1- ≤ 4
2X2 ≤ 12 => 2X2 ≤ 12
3X1+2X2 ≤ 18 3X1+ - 3X1- + 2X2 ≤ 18
and X2 ≥ 0 (only) and X1+ ≥ 0, X1- ≥ 0, X2 ≥ 0
- Disadvantage : The new equivalent model to be used has more variables than
the original model.
- In fact, if all the original variables lack lower-bound constraints, the new model
will have twice as many variables.
- This modification is done by replacing each such variable Xj by
Xj = Xj’- X” , where Xj’ ≥ 0 , X” ≥ 0
Instead, where X” is the same variable for all relerant j.
- The interpretation of X” in this case. Is that –X” is the current value of the largest
(in absolute terms) negative original variable, so that Xj’ is the amount by which
Xj exceeds this value.
- Thus, the simplex method now can make some of the Xj’ variables larger than
zero. Even when X” ≥ 0.
Example ( LP model )
EX. Minimize Z = 4X1 + X2
Subject to 3X1 + X2 = 3
4X1 + 3X2 ≧ 6
X1 + 2X2 ≦ 4
39
and X1 ≧ 0 , X2 ≧ 0
=>Minimize Z = 4X1 + X2 + M X 3 +M X 5
Subject to 3X1 + X2 + X 3 = 3
4X1 + 3X2 –X4 + X 5 = 6
X1 + 2X2 + X6 = 4
And X1 ≥ 0,X2 ≥ 2, X 3 ≥ 0,X4 ≥ 0, X 5 ≥ 0,X6 ≥ 0
(where X 3 , X 5 :artificial variables;X4:surplus variable;X6:slack variable)
=>Maximize -Z = -4X1 – X2 - M X 3 - M X 5
- Solving the problem:
(0) -Z+4X1+X2+ M X 3 +M X 5 =0
(1) 3X1+X2+ X 3 =3
(2) 4X1+3X2- X4 + X 5 =6
(3) X1 + 2X2 + X6 =4
The basic variable X and X 5 still need to be algebraically eliminated from Eq.(0)
3
X1 X2 X3 X4 X5 X6 =
Row 0:〔 4 1 M 0 M 0, 0〕
Eq.(1)-Mx〔 3 1 1 0 0 0, 3〕
Eq.(2)-Mx〔 4 3 0 -1 1 0, 0〕
New Row0:〔 -7M+4, -4M+1, 0, M, 0, 0, -9M〕
40
Optimal solution is :
X1 = 2/5 and X2 = 9/5
With Z = 17/5
Farmer’s Example
EX. A farmer is raising pigs for market, and he wishes to determine the quantities of
the available types of feed that should be given to each pig to meet certain nutritional
requirements at minimum cost. The number of units of each type of basic nutritional
ingredient contained within a kilogram of each feed type is given in the following
table, along with the daily nutritional requirements and feed costs:
(b) Rewrite this model in an equivalent way to fit our standard form.
(c) Construct the initial simplex tableau, introducing artificial variables and so forth
41
Farmer’s Example
(sol):
(a) Define the three decision variables as follows:
X 1= th ek ilo g r aomf c o r n
X 2= th ek ilo g r aomf ta n k a g e
X 3= th ek ilo g r aomf a lf a lf a
Minimize: Z = 7X1 + 6X2 + 5X3
Subject to: 9X1 + 2X2 + 4X3 ≥ 20
3X1 + 8X2 + 6X3 ≥ 18
X1 + 2X2 + 6X3 ≥ 15
and X1 ≥ 0 , X2 ≥ 0 , X3 ≥ 0
(b) Maximize: -Z = -7X1 - 6X2 - 5X3
Subject to: -9X1 - 2X2 - 4X3 ≤ 20
-3X1 - 8X2 - 6X3 ≤ 18
-X1 - 2X2 - 6X3 ≤ 15
and X1 ≥0 , X2 ≥0 , X3 ≥0
(c) we need to introduce three surplus variable X4 , X6 , X8 , and three artificial
variables X5, X7, X9
∴ 9X1+2X2+4X3-X4+ X 5 = 20
3X1+8X2+6X3-X6+ X 7 = 18
X1+2X2+6X3-X8+ X 9 = 15
42