



























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An example of the branch and bound algorithm used to find the optimal solution of a linear programming problem. The algorithm involves recursively exploring the search space by branching on variables and pruning branches that cannot lead to an optimal solution based on the current best solution and the bounds obtained from linear programming relaxations.
Typology: Study notes
1 / 67
This page cannot be seen from the preview
Don't miss anything!




























































8/11/2009 Vira ChankongEECS, CWRU 1
8/11/2009 Vira ChankongEECS, CWRUVira ChankongEECS. CWRU 22
Case Western Reserve UniversityCase Western Reserve University Electrical Engineering and Computer ScienceElectrical Engineering and Computer Science
8/11/2009 Vira ChankongEECS, CWRU 3
NEOS Guide Optimization Tree
8/11/2009 Vira ChankongEECS, CWRU 4
Discrete Optimization ProblemsDiscrete Optimization Problems
8/11/2009 Vira ChankongEECS, CWRU 7
Suppose that you are organizing housing accommodations for a group of four hundred university students. Space is limited and only one hundred of the students will receive places in the dormitory. To complicate matters, the Dean has provided you with a list of pairs of incompatible students, and requested that no pair from this list appear in your final choice. This is an example of what computer scientists call an NP-problem, since it is easy to check if a given choice of one hundred students proposed by a coworker is satisfactory (i.e., no pair taken from your coworker's list also appears on the list from the Dean's office), however the task of generating such a list from scratch seems to be so hard as to be completely impractical. Indeed, the total number of ways of choosing one hundred students from the four hundred applicants is greater than the number of atoms in the known universe! Thus no future civilization could ever hope to build a supercomputer capable of solving the problem by brute force; that is, by checking every possible combination of 100 students. However, this apparent difficulty may only reflect the lack of ingenuity of your programmer. In fact, one of the outstanding problems in computer science is determining whether questions exist whose answer can be quickly checked, but which require an impossibly long time to solve by any direct procedure. Problems like the one listed above certainly seem to be of this kind, but so far no one has managed to prove that any of them really are so hard as they appear, i.e., that there really is no feasible way to generate an answer with the help of a computer. Stephen Cook and Leonid Levin formulated the P (i.e., easy to find) versus NP (i.e., easy to check) problem independently in 1971.
P vs NP: A Millennium Problem
8/11/2009 Vira ChankongEECS, CWRU 8
Highlights:
Discrete Optimization
8/11/2009 Vira ChankongEECS, CWRU 9
Modeling Discrete Optimization andModeling Discrete Optimization and IP: ExamplesIP: Examples
8/11/2009 Vira ChankongEECS, CWRU 10
The time in minutes it takes an ambulance to travel from one district to another is show n below. The population of each district in thousands is also show n. Find districts to locate 2 ambulances so as to maximize the number of people w ho lives w ithin 2 minutes of an ambulance. To District 1 2 3 4 5 6 7 8 1 0 3 4 6 8 9 8 10 From 2 3 0 5 4 8 6 12 9 District (^) 3 4 5 0 2 2 3 5 7 4 6 4 2 0 3 2 5 4 5 8 8 2 3 0 2 2 4 6 9 6 3 2 2 0 3 2 7 8 12 5 5 2 3 0 2 8 10 9 7 4 4 2 2 0 # of population in 1000s 8 3 5 9 4 1 7 2
8/11/2009 Vira ChankongEECS, CWRU 13
Solution (Ambulance): Decision Variables: 1 2 3 4 5 6 7 8 Locate in district i? Xj^^0 0 0 0 1 1 0 District i covered? Yj^0 0 1 1 1 1 1 Objective Function: # of people within 2 minutes of ambulance:^28 Constraints: To District? 1 2 3 4 5 6 7 8 Yi Sum[a(ij)Xj)] 1 1 0 0 0 0 0 0 0 0 0 2 mins 2 0 1 0 0 0 0 0 0 0 0 From^3 0 0 1 1 1 0 0 0 1 District^4 0 0 1 1 0 1 0 0 1 5 0 0 1 0 1 1 1 0 1 2 6 0 0 0 1 1 1 0 1 1 2 7 0 0 0 0 1 0 1 1 1 1 8 0 0 0 0 0 1 1 1 1 1
Number of ambulances^2 must equal 2
8/11/2009 Vira ChankongEECS, CWRU 14
A salesman in city 1 wants to visit each and every city once and returns to city 1. Find a “tour” with minimum distance.
1
2
3
4 6
5
7
8
1
1
Traveling Salesman Problem (TSP) Traveling Salesman Problem (TSP)
1
2
2
5
1
4
2
2
1
1
8/11/2009 Vira ChankongEECS, CWRU 15
TSP Model 1TSP Model 1
8 8 1 1
1 if segment from to is taken Variables: 0 otherwise
Objective Functio
n:
Constraints: For e
ij
i j ij^ ij
x i^ j i j j i c x = =
∑∑
8 1 8 1
ach city, exactly one inbound: 1, 1,..,
exactly one outbound: 1, 1,..,
i^ ij
j ij
x j
x i
=
=
∑
∑
20 20 20 1 2 20 2 20 20 20 4 20 20 2 20 1 20
20
2
20
1
1
20
5
2
1
20
1
20
20
20
1
1
20 2 5 20 20 20 2 20 20 4 20
20 1 20 1 20
20 20 2 20 1
20 20 1 20 20
20 20 20 20 20
12 21 13 31 23 32 24 42
1;
No subtour of 2 citie 1; 1; 1
s
;
: x x x x x x x x
25 52 34 43 37 73 46 64 56 65 58 85 67 76 78 87
1; 1; 1; 1; 1; 1; 1; 1;
x x x x x x x x x x x x x x x x
8/11/2009 Vira ChankongEECS, CWRU 16
TSP Model 1TSP Model 1
No subtour of 3 or more citi 2; 2; 2; 2;
3; 3;
e
3;
s
3 3 3
:
; ;
x x x x x x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x
56 67 78 85 58 87 76 65
; 3; 3; No need for constraints on more than 4 cities
x + x + x + x ≤ x + x + x + x ≤
8/11/2009 Vira ChankongEECS, CWRU 19
TSP Model 4 TSP Model 4
1
1 9 8 1
1
Variables:
Objective Function:
city visited on the tour = 1,.., 1; 1
Each occurs exactly once and they are alldifferent (
Constraints:
,
i i
i th
i y y
i
y i i y y c
y alldifferent y
=^ +
∑
.., y 8 )
20 20 20 1 2 20 2 20 20 20 4 20 20 2 20 1 20
20
2
20
1
1
20
5
2
1
20
1
20
20
20
1
1
20 2 5 20 20 20 2 20 20 4 20
20 1 20 1 20
20 20 2 20 1
20 20 1 20 20
20 20 20 20 20
8/11/2009 Vira ChankongEECS, CWRU 20
TSP Model 5 TSP Model 5
8 1
city visited after city , = 1,..,
Begin at city 1 End at city 1 a
Variables:
Objective Function:
Constraints
nd other occurs exactly once and they are alldif
: fe
i
i i iy
i
y i i c
y
=
= ∑
1 8
rent circuit y ( ,.., y )
20 20 20 1 2 20 2 20 20 20 4 20 20 2 20 1 20
20
2
20
1
1
20
5
2
1
20
1
20
20
20
1
1
20 2 5 20 20 20 2 20 20 4 20
20 1 20 1 20
20 20 2 20 1
20 20 1 20 20
20 20 20 20 20
8/11/2009 Vira ChankongEECS, CWRU 21
8/11/2009 Vira ChankongEECS, CWRU 22
8/11/2009 Vira ChankongEECS, CWRU 25
Modeling piecewise linear functions
Note: It does not model the w ’s perfectly. ¾Suppose x 1 = 10, x 2 = x 3 = 0; ¾Then w 1 = 0 or 1 ¾Cost = 20,000, regardless
8/11/2009 Vira ChankongEECS, CWRU 26
Modeling Logical Constraints
The cash amount of $14,000 is available for investing on 6 securities, The cash required from each investment as well as the NPV of the investment is below.
NPV ($1000s)
Cost ($1000s)
Investment
8/11/2009 Vira ChankongEECS, CWRU 27
IP Model: 1 0
, if we invest in i 1,...,6, i , else x
⎧ = = ⎨ ⎩
Variables:
Objective: Maximize total NPV Max: 16 x 1 + 22 x 2 + 12 x 3 + 8 x 4 + 11 x 5 + 19 x 6 Constraints: Total cash available: 5 x 1 + 7 x 2 + 4 x 3 + 3 x 4 + 4 x 5 + 6 x 6 ≤ 14 Indivisibility of investment: x (^) j ∈ {0,1} for each j = 1 to 6
8/11/2009 Vira ChankongEECS, CWRU 28
Additional Constraints: Logical
8/11/2009 Vira ChankongEECS, CWRU 31
More logical constraint: Stock 1 must be selected unless the NPV of the portfolio exceeds $42,000.
If NPV < 42 then x 1 =1.
⇒ x 1 ≥ (42 – NPV)/
⇒Add constraint:
42 x 1 ≥ 42 - (16 x 1 +22 x 2 +12 x 3 +8 x 4 +11 x 5 +19 x 6 )
Note: NPV = 16 x 1 +22 x 2 +12 x 3 +8 x 4 +11 x 5 +19 x 6
8/11/2009 Vira ChankongEECS, CWRU 32
The Cons of Discrete Optimization/IP The Cons of Discrete Optimization/IP
8/11/2009 Vira ChankongEECS, CWRU 33
Example: Different ways of modeling the same things and their effects on solution methods:
Why? Must know how algorithms work!!!
8/11/2009 Vira ChankongEECS, CWRU 34
Solution Methods for Solving Solution Methods for Solving Integer ProgramsInteger Programs
8/11/2009 Vira ChankongEECS, CWRU 37
8/11/2009 Vira ChankongEECS, CWRU 38
8/11/2009 Vira ChankongEECS, CWRU 39
Capital Budgeting Example
Investment budget = $14,
maximize 16 x 1 + 22 x 2 + 12 x 3 + 8 x 4 +11 x 5 + 19 x 6 subject to 5 x 1 + 7 x 2 + 4 x 3 + 3 x 4 +4 x 5 + 6 x 6 ≤ 14 x (^) j binary for j = 1 to 6
NPV ($1000s
Cost ($1000s)
Investment
16
8/11/2009 Vira ChankongEECS, CWRU 40
Complete Enumeration for 0-1 IPs