Lecture Notes 3

Lecture 3
General Classification of Mathematical Programming Models
(or Optimization Techniques)
A. General
The general (nonlinear) LP model can be stated as finding the decision
variables x1 ... xn that maximize (/minimize) the objective function:
z = f0 (x1, x2, ...xn)
subject to the following constraints:
f1(x1, x2, ...xn)  b1
f2(x1, x2, ...xn)  b2
.
.
.
fm (x1, x2, ...xn)  bm
and (non-negativity/negativity)
x1  0 (usually, sometimes -ve)
x2  0
.
.
.
xn  0
B. Linear Programming (LP)
The objective function and constraints are linear functions of the decision
variables (if decision variables have exponent = 1 => LP):
maximize (minimize) z = c1 x1 + c2 x2 + ... cn xn
subject to:
a11 x1 + a12 x2 + ...a1n xn  b1
a21 x1 + a22 x2 + ...a2n xn  b2
.
.
.
am1 x1 + am2 x2 + ...amn xn  bm
and
23
(m = row no., n = column no.)
x1  0 (usually)
x2  0
.
.
xn  0
In LP, the decision space is continuous and fractional answers are allowed.
(all numbers are either whole or fraction)
C. Integer Programming (IP)
In IP, the decision variables are restricted to integer values (e.g., standard
pipe diameters for water supply)
These are difficult problems to solve.
The “network” and “binary” problems are special classes of IP
Mixed IP/LP is more common in water resources, where only some
decision variables are restricted to taking on integer values.
D. Nonlinear Programming
Nonlinear objective function and/or constraints. The optimal solution may
no longer be at the corner point of a feasible region -- the solution is more
difficult to find than an LP solution.
E. Static vs. Multistage Models
One time period vs. multiple time-period models
Dynamic Programming is one way of solving multistage problems
F. Deterministic vs. Stochastic Models
In deterministic models, the parameters are known constants
In stochastic models, the parameters are not known precisely and are
characterized by probability distributions
24
Integer Programming
Outline:
A. Definition
B. Important Applications
1. Budgeting
2. Location selection
3. Scheduling
C. Formulation Considerations
D. Example Solution Technique -- Branch and Bound
A. Definition: A Subset of LP Problems
1. Pure integer programming problems -- all decision variables are restricted to
integer values
2. Mixed integer (-linear) programming problems -- some but not all decision
variables are restricted to integer values
3. Formulation
n
minimize z =

cj xj
j 1
n
subject to

aij xj  bi
i = 1,2, …., m
j 1
xj  0
j = 1,2, …., n
xj integer (for some or all j = 1, 2, ..., n)
4. Solution considerations
a. If the problem can be formulated as a network problem, integrality
restrictions are not needed, and solving the linear program results in
integer values
b. Otherwise, solving the linear program results in fractional values and
measures need to be taken to ensure an integer solution
B. Important Applications
1. Budgeting problems
a. General description
Want to choose best possible combination of, e.g., investments to
maximize benefits (capital investment decisions)
25
b. Formulation
n
maximize total contribution (total benefits)

cj xj
j 1
where cj is the contribution (e.g., $) resulting from the jth
investment, e.g., benefits from the jth treatment plant or
reservoir built (xj = 0 or 1 for investment accepted/not
accepted)
subject to
resources constraints
n

aij xj  bi
i = 1, 2, …., m
j 1
where aij is the amount of resource i ($, manpower) used on jth
investment
bi is the total resource i available
Could also look at i as representing different periods, bi as $
available per period for total investments and aij as $ for
investment j in period i
xj = 0 or 1
j = 1, 2, ..., n
xj = 0 if investment is not accepted
= 1 if investment is accepted
Note: When xj is 0 or 1, this is a special type of integer variable
called a BINARY variable. This implies a “go/no-go” decision,
i.e., you decide to either invest or not invest in an activity. No
partial investments are made.
c. Special considerations: contingency constraints
Suppose a second set of projects is contingent upon a first set being
completed; e.g., what if hydropower generation at a particular site is
contingent upon a new reservoir being built at the same site.
Introduce a second decision variable yj = {0, 1} and the constraint
xj  yj
where xj is the yes/no decision variable on building a reservoir
yj is the yes/no decision variable on hydropower generation
26
If yj = 1 (hydropower generation is accepted), then xj = 1 necessarily (a
reservoir must be built).
d. Multiple choice constraints
x1+ x2 + x3 + x4  1
Since xj = {0,1}, this constraint says that at most one of four
investments (projects) can be accepted; e.g., if x1 = 1, then x2 = x3= x4
= 0.
e. Budgeting problem: the “knapsack problem”. See BHM if interested.
2. Location problems
a. Description
E.g., distribution centers (pumping stations, wastewater treatment plants, well
locations)
Important in looking at tradeoffs between transportation costs and costs for
operating distribution centers, in modeling distribution systems.
b. Example (Mixed IP-LP)
(1) Description
Want to decide which of n facilities to use (build) to meet demands of
m customers for water supply (which facility to build (operate) and
how much to ship from any facility to a customer)
Let yi = 1 if facility i is built (operated)
= 0 if facility i is not built (operated)
xij = amount of water to be sent from facility i to customer j
f i = fixed cost for operating (constructing) the facility
cij = unit operating cost at the facility plus transportation cost from
facility i to customer j
(2) Constraints
-- demands dj of each customer
-- water can be transported only if a facility is operating
27
(3) Formulation
m
m
n

minimize
cij xij +
i 1 j 1
 fi yi
i 1
variable cost
for producing
and shipping
fixed cost for operating
(building) facilities
Total supply to customer j
Total demand by customer j
subject to
m

xij  dj
j = 1, 2, ...n
i 1
Total supply from
facility i only
Demand constraint
(min. demand must be fulfilled)
n

n
xij - yi
j 1
yi = 0 or 1
... … … (1)

j 1
dj  0
i = 1, 2, ..., m
... … … (2)
Total demand by all customers
This constraint assures that nothing will be shipped from an an
inoperable facility.
When yi = 1 (the facility is operating), the sum of xij from that facility
minus the demand from that facility will be always  0.
When yi = 0 (the facility is not operating), the sum of xij must be ≤ 0,
but since xij cannot be –ve, all xij = 0.
xij ≥0
i = 1, 2, ..., m; j = 1, 2, ..., n
xij is a continuous, linear decision variable
yi = 0 or 1
i = 1, 2, ..., m
... … … (3)
... … … (4)
Therefore this is a mixed IP-LP problem.
c. Additional constraints on a location problem could include:
(1) multilevel distribution systems from source to distribution (treatment,
pumping) center to customer
xijk (plant i, distribution center j, customer k)
(2) capacity constraints
-- production (e.g., reservoir releases)
-- distribution point throughput (amount pumped, treated)
replace yi in constraint (2) with yiki where ki = distribution
throughput capacity (percent/fraction)
28
(3) economies of scale -- transportation, operating costs
the more produced, the cheaper the cost per unit
(4) service considerations -- e.g., maximum distribution periods
(affect cost of production/distribution)
(5) multiple “products” -- e.g., distribution of high quality (drinking) water
and low quality (irrigation) water
(6) conditions preventing multiple distribution points serving one
customer
if for some reason want all of one product to come from one
distribution point
3. Scheduling problems (sequencing, routing)
a. Definition
Want to determine which of several projects to build and in what order
b. Formulation
Let xij = 1 if project at site i ( i = 1,... m) is built in year j (j = 1,...n)
= 0 otherwise
Bij = present value of net benefits if project at site i is built in year j
ci = cost of constructing project at site i
bj = funds available for investment in year j
We want to maximize the present value of net benefits:
m
maximize
n

Bij xij
i 1 j 1
where m = total no. of sites (projects)
n = total no. of years
subject to
j
m

k 1 i 1
ci xik 
j
 bk
j = 1,2,...n
(year)
... … … (1)
k 1
have one constraint for each year j
the sum of the costs of the projects up to year j do not
exceed the total funds available up to year j
29
n

xij  1
i = 1, 2, ..., m
(site)
... … … (2)
j 1
Each project can be built at most one time at a site over n
years
... … … (3)
xij = 0 or 1
Could have the additional constraint:
m

xij  1
j = 1, 2, ..., n
... … … (4)
i 1
have one constraint for each year j
At most one project may be built in any one year.
(The way we formulated the problem originally, more than
one project could be built in one year as long as the budget
was not exceeded).
C. Formulation Considerations
1. Binary variables -- Used to decide whether or not to do something
yes-no decision variables
go- no go "
"
binary
"
"
logical
"
"
1-0
"
"
all are synonyms
Also can be used to decide on one out of several alternatives, e.g., if
want to decide on at most 1 out of 3 activities,
3

xj  1
j 1
is a multiple choice constraint
2. Logical constraints -- timing restrictions, contingencies, conflicting alternatives
a. Constraint feasibility
(1) General description
We may want to formulate a problem to check if the following
constraint would be satisfied:
30
f(x1, x2, ...xn)  b
where b is a positive number.
Let y = 0 mean that the constraint is satisfied
y = 1 otherwise
Then we can write,
f(x1, x2, ...xn) - By  b
where B is a very large +ve number (relatively speaking) (e.g., 106)
Note that this equation always holds for y = 1, but y must be zero for
the original constraint to hold. So, if we find y = 0, we know that the
original constraint has been satisfied.
(2) Example (Location Problem)
We want to indicate whether or not a well is installed at location i.
Suppose we want to minimize total variable and fixed costs of
pumping, i.e.,
m
min

ci wi + biyi
i 1
where ci = costs associated with variable pumping rate wi
bi = costs associated with installing well at location i
wi = pumping rate at location i
yi = yes/no well is installed at location i
subject to
wi - Byi  0
where B = a relatively large number
If wi > 0 (i.e., have pumping), then this constraint forces yi = 1 (well is
installed) under such conditions. (yi would prefer to be zero for a cost
minimization problem).
b. Alternative constraints
We may have a situation where at least one of the two constraints (not
necessarily both) must be satisfied:
f1(x1, x2, ...xn)  b1
f2(x1, x2, ...xn)  b2
31
A logical constraint can be combined with a multiple choice
constraint:
f1(x1, x2, ...xn) – B1y1  b1
f2(x1, x2, ...xn) – B2y2  b2
y1 + y2  1
This forces at least one constraint to be
satisfied (i.e., at least one yi must be
zero; yi = 0 => constraint is satisfied)
y1 , y2 = 0 or 1
This problem could also be formulated as follows to satisfy either one
of the constraints:
f1(x1, x2, ...xn) – B1y1  b1
f2(x1, x2, ...xn) – B2 (1 - y1 )  b2
y1 = 0 or 1
32
Case Study: DWASA Water Distribution Network
An Optimization Model for a Selected Region of Dhaka
WASA Water Supply System
(M.Sc. Thesis: Aminur Rahman Shah)
Objective Function:
Uttara Sub-network (DTW)
m
 Ci Xi
Minimize
i =1
where Ci = cost coefficient (Taka/m3) of DTWi which
produces Xi amount of water (m3/month), and m = total
number of DTWs in the system. Also, Xi ≥ 0.
Constraints:
m
 Xi
> D
(1)
i =1
where D = total water demand in a given month (m3/month).
Xi < Yi Cpi
(2)
and DTWi is stopped if production from the well is less
than a specified amount, i.e.
XLYi - Xi
< 0 (3)
where Cpi = production capacity of DTWi, Yi = binary logical variable = 0 or 1, and XL =
1,000 liter/minute = 1 m3/minute.
Equation (3) forces Yi to take up a value of 0 (DTWi does not operate) if Xi ≤ 1
m /minute. Additionally, ∑Yi ≤ m, Yi ≥ 0, Yi ≤ 1, and Yi = integer. Equation (2)
limits the maximum amount of water produced from DTWi within the production
capacity (Cpi) if the well operates (Yi = 1). If DTWi does not operate (Yi = 0) the
corresponding production (Xi) must be equal to 0.
3
To ensure local supply from each DTW, the well should not remain inoperative for
several consecutive days. So each DTW, even if its production cost is relatively high,
should produce a minimum amount of water to meet the local demand to some extent.
Assuming 8 -10 hours per day operation, the minimum monthly water production from
each DTW is equivalent to 40% of the water production capacity. Thus,
Xi ≥ XC
(4)
where XC = 0.4 Cpi. Equation (3) may become redundant to equation (4) if Cpi is
relatively high.
33
Results:
Total cost (x10 3 Taka)
(1) Cost Minimization:
2,200
2,000
1,800
1,600
1,400
1,200
1,000
800
600
400
Jul-01
A ug-01
Sep-01
Oct-01
No v-01
Dec-01
Jan-02
Feb-02
M ar-02
A pr-02
M ay-02
Jun-02
Month
Recorded
At 31% loss
At 50 % loss
At 28% loss
At 35% loss
Figure 3: Cost of Water Production in Actual (Recorded) and Optimal Conditions
During July/01- June/02
DTWs to be operated for minimum production
34
Uttara-12
Uttara-13
Dakshin Khan
Askona
Uttara-11
July
August
September
October
November
December
January
February
March
April
May
June
Kawlar-2
Kawlar-1
Uttara-9/B
Uttara-9/A
Uttara-5
Uttara-4
Uttara-3
Uttara-2
Uttara-1
Name of DTW
Chalabon
2002
2001
Year
Month
-
-
-
-
Total no. of DTWs in
minimum production
Total optimum water
production (x103 m3)
(2) Optimal Pumping Schedule:
7
6
3
3
2
4
5
5
4
4
3
2
901
1139
1363
1388
1471
1324
1393
1405
1483
1479
1568
1621
(3) Scenario Analysis:
Optimum cost
(x103 Taka/month)
(a) Scenario 1: Reduced Number of DTWs
2,000
1,800
1,600
1,400
1,200
1,000
800
600
400
200
0
Scenario 1
Existing
50%
35%
31%
Loss level
28%
Optimum cost
(x103 Taka/ month)
(b) Scenario 2: Increased Number of DTWs
2,000
1,800
1,600
1,400
1,200
1,000
800
600
400
200
0
Scenario 2
Existing
50%
35%
31%
Loss level
35
28%