Beruflich Dokumente
Kultur Dokumente
CS 325
Spring 2016
S ≥ 0, L ≥ 0.
Graphical Method
for Linear Programming
#Large Wind
Turbine
# Small Wind
Turbines
Graphical Method
for Linear Programming
# Small Wind
Turbines
Graphical Method
for Linear Programming
#Large Wind
Turbine
# Small Wind
Turbines
Violates Divisibility Assumption
of LP
• Divisibility Assumption of Linear Programming:
Decision variables in a linear programming model are
allowed to have any values, including fractional values,
that satisfy the functional and nonnegativity constraints.
• Disadvantages
– More difficult to model
– Can be much more difficult to solve
Integer Programming
• When are “non-integer” solutions okay?
– Solution is naturally divisible
• e.g., pounds, hours
– Solution represents a rate
• e.g., units per week
• When is rounding okay?
– When numbers are large
• e.g., rounding 114.286 to 114 is probably okay.
• When is rounding not okay?
– When numbers are small
• e.g., rounding 2.6 to 2 or 3 may be a problem.
– Binary variables
• yes-or-no decisions
• Binary Integer Programming
Danish Green Power Example
Capital Budgeting Allocation Problem
Investment 1 2 3 4 5 6
Cost (millions 5 7 4 3 4 6
dollars)
Total production 16 22 12 8 11 19
(100KW)
Capital Budgeting Allocation Problem (one resource)
Knapsack Problem
• Why is a problem with the characteristics of the previous problem
called the Knapsack Problem?
• It is an abstraction, considering the simple problem:
A 2-dimensional
representation
x2
Item 2
x1 x2
Item 1
x1
If item 1 is selected then item 3 is
not selected
The integer programming constraint:
A 2-dimensional
representation
Item 3
x1 + x3 1
item 1
Either item 4 is selected or item 5
is selected, but not both.
The integer programming constraint:
A 2-dimensional
representation
Item 5
x4 + x5 = 1
Item 4
How to model “logical” constraints
• Exactly 3 items are selected. x1+ x2+ x3+ x4+ x5+ x6=3
• If item 2 is selected, then so is item 1. x1 x2
• If item 1 is selected, then item 3 is not selected.
x1 + x3 1 x1 1- x3
• Either item 4 is selected or item 5 is selected,
but not both.
x4 + x5 = 1
Modeling Fixed Charge
Problems
If a product is produced, a factory is built must incur a fixed
setup cost.
The problem is non-linear.
x – quantity of product to be manufactured
x = 0 cost =0;
x > 0 cost = C1x + C2
How to model it? Using an indicator variable y
y = 1 x is produced; y = 0 x is not produced
Objective function becomes C1x + C2y
Additional Constraint x ≤ My
M is a big number
Controlling Pollution on the Vecht River in Weesp
Because of pollution on the Vecht River in Weesp, in the
Netherlands, the city is going to build some pollution control
stations. Three sites (1, 2, and 3) are under consideration. They
are interested in controlling pollution levels for two pollutants (A
and B). The city legislature mandates that at least 80,000 tons of
pollutant A and at least 50,000 tons of pollutant B be removed from
the river. Formulate an MIP (Mixed Integer Program) to minimize
cost of meeting the city pollution requirements.
x2 = 0 x2 = 1 x2 = 0 x2 = 1
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
On complete enumeration
• Suppose that we could evaluate 1 billion solutions per
second.
• Let n = number of binary variables
• Solutions times (worst case, approx.)
– n = 30, 1 second
– n = 40, 18 minutes
– n = 50 13 days
– n = 60 31 years
On complete enumeration
• Suppose that we could evaluate 1 trillion solutions per
second, and instantaneously eliminate 99.9999999% of all
solutions as not worth considering
• Let n = number of binary variables
• Solutions times
– n = 70, 1 second
– n = 80, 17 minutes
– n = 90 11.6 days
– n = 100 31 years
Branch and Bound
Solution at node 1:
x1 =1 x2 = 3/7 x3 = x4 = x5 = 0 x6 =1 z = 44 3/7
Solution at node 2:
x1 = 0 x2 = 1 x3 = 1/4 x4 = x5 = 0 x6 = 1 z = 44
Branch and Bound
Node 3 is the
44 3/7 original LP
1
Relaxation plus
x1 = 0 x1 = 1 the constraint
x1 = 1.
44 2 3 44 3/7
44 2 3 44 3/7
x2 = 0
42 44
Solution at node 4: 0 0 1 0 1 1 z = 42
Our first incumbent solution! No solution in
No further searching from node 4 because the subtree can
have a value
there cannot be a better integer solution. better than 42.
Branch and Bound
The incumbent The
is the best incumbent
44 3/7
solution on 1 solution has
hand. value 42
x1 = 0 x1 = 1
44 2 3 44 3/7
x2 = 0 x2 = 1 x2 = 0 x2 = 1
42 44 44 5 44 6 44 1/3 7
44 2 3 44 3/7
x2 = 0 x2 = 1 x2 = 0 x2 = 1
42 44 44 5 44 6 44 1/3 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
42 4 44 5 44 6 44 1/3 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43.75 42.66
42 4 44 5 44 6 44 1/3 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43.75 42.66
Branch and Bound
1 44 The
incumbent
x1 = 0 x1 = 1 solution has
value 42
44 2 3 44
x2 = 0 x2 = 1 x2 = 0 x2 = 1
42 4 44 5 44 6 44 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43 8 43 9 43 10 43 11 44 12 - 13
43 42 43 42 43 43
42 4 44 5 44 6 44 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43 88 43 99 10
43 10 11
43 11 44 12 - 13
43 42 43 42 43 43
42 4 44 5 44 6 44 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43 88 43 99 10
43 10 11
43 11 44 12 - 13
42 4 44 5 44 6 44 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
43 88 43 99 10
43 10 11
43 11 44 12 - 13
44 14 15 -
44 16 17 -
38 18 19 -
Lessons Learned
• Branch and Bound can speed up the search
• We sometimes use properties that are obvious to us, such as the fact
that integer solutions have integer solution values
Branch and Bound
Notation:
– z* = optimal integer solution value
– Subdivision: a node of the B&B Tree
– Incumbent: the best solution on hand
– zI: value of the incumbent
– zLP: value of the LP relaxation of the current node
– Children of a node: the two problems created for a
node, e.g., by saying xj = 1 or xj = 0.
– LIST: the collection of active (not fathomed) nodes,
with no active children.
NOTE: zI z*
Illustrating the definitions
The incumbent
44 3/7 solution has
1 value 42
x1 = 0 x1 = 1
44 2 3 44 3/7
x2 = 0 x2 = 1 x2 = 0 x2 = 1
42 44 44 5 44 6 44 1/3 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
44 2 3 44 3/7
x2 = 0 x2 = 1 x2 = 0 x2 = 1
42 44 44 5 44 6 44 1/3 7
x3 = 0 x3 = 1 x3 = 0 x3 = 1 x3 = 0 x3 = 1
CASE 3. zI < zLP and xLP is integral. e.g., node 4 was selected,
That is, the LP solution is integral and and the solution to the LP
dominates the incumbent. was integer-valued.
X1 =0 X1 =1 Choosing how to
branch so as to
X2 =0 X2 =1 X8 = 0 X8 = 1 reduce running
time is largely
X =0
“art” and based
3
3= 0
X
X3 = 0
X3= 1 on experience.
X 3= X 3= 1 X3 =1
X3 = 1 0
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
Different Branching Rules are
Possible
• Branching: determining children for a node. There are
many choices.
• Rule of thumb 1: if it appears clear that xj = 1 in an
optimal solution, it is often good to branch on xj = 0 vs xj =
1.
– The hope is that a subdivision with xj = 0 can be
pruned.
• Rule of thumb 2: branching on important variables is
worthwhile
Different Bounding Techniques are Possible
In Linear Programming, the contribution of each activity to the value of the objective
function Z is proportional to the level of the activity xj as represented by the cjxj term;
The contribution of each activity to the left-hand side of each functional constraint is
proportional to the level of the activity xj as represented by the term aij.
This assumption implies that all the x terms of the linear equations cannot
have exponents greater than 1.
Note: if there is a term that is a product of different variables, even though the
proportionality assumption is satisfied, the additivity assumption is violated.
But there are many situations, in which proportionality is not a realistic assumption.
Examples of violation of proportionality
assumption: Startup Costs
Optimization Problem
Decision Problem Decision Problem Optimization Problem Knapsack
Graph Coloring Set Covering Linear Programming
What Renewable Energy
Can we color a Can we protect How to minimize Investments should the
map with 4 colors? the forest with Pulp mill pollution? Danish Green Power Company
10 forest rangers? pick to maximize profit?
Decision/Optimization Individual
Problems Perspective
Linear Non-linear
Stochastic Social
Deterministic
Perspective
Single-Agent Multi-Agent
Solution Methods