Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integer Programming and Branch and Bound Brian C. Williams 16.410-13 November 15 th, 17 th, 2004 Adapted from slides by Eric Feron, 16.410, 2002.

Similar presentations


Presentation on theme: "Integer Programming and Branch and Bound Brian C. Williams 16.410-13 November 15 th, 17 th, 2004 Adapted from slides by Eric Feron, 16.410, 2002."— Presentation transcript:

1 Integer Programming and Branch and Bound Brian C. Williams 16.410-13 November 15 th, 17 th, 2004 Adapted from slides by Eric Feron, 16.410, 2002.

2 Cooperative Vehicle Path Planning Vehicle Waypoint Obstacle

3 Cooperative Vehicle Path Planning Vehicle Waypoint Obstacle

4 Cooperative Vehicle Path Planning Objective: Find most fuel-efficient 2-D paths for all vehicles. Constraints: –Operate within vehicle dynamics – Avoid static and moving obstacles – Avoid other vehicles –Visit waypoints in specified order –Satisfy timing constraints

5 Outline What is Integer Programming (IP)? How do we encode decisions using IP? –Exclusion between choices –Exclusion between constraints How do we solve using Branch and Bound? –Characteristics –Solving Binary IPs –Solving Mixed IPs and LPs

6 Integer Programs LP: Maximize 3x 1 + 4x 2 Subject to: x 1 ≤ 4 2x 2 ≤ 12 3x 1 + 2x 2 ≤ 18 x 1, x 2 ≥ 0 IP: Maximize 3x 1 + 4x 2 Subject to: x 1 ≤ 4 2x 2 ≤ 12 3x 1 + 2x 2 ≤ 18 x 1, x 2 ≥ 0 x 1, x 2 integers e) x1x1 x2x2

7 Integer programs are LPs where some variables are integers Why Integer programs? 1.Some variables are not real-valued: Boeing only sells complete planes, not fractions. 2.Fractional LP solutions poorly approximate integer solutions: For Boeing Aircraft Co., producing 4 versus 4.5 airplanes results in radically different profits. Often a mix is desired of integer and non-integer variables Mixed Integer Linear Programs (MILP). Integer Programming

8 Graphical representation of IP

9 Outline What is Integer Programming (IP)? How do we encode decisions using IP? –Exclusion between choices –Exclusion between constraints How do we solve using Branch and Bound? –Characteristics –Solving Binary IPs –Solving Mixed IPs and LPs

10 Encode “Yes or no” decisions with binary variables: 1 if decision is yes xjxj 0 if decision is no. Binary Integer Programming (BIP): Binary variables + linear constraints. How is this different from propositional logic? Integer Programming for Decision Making

11 Problem: 1.Cal wants to expand: Build new factory in either Los Angeles, San Francisco, both or neither. Build new warehouse (at most one). Warehouse must be built close to the city of a new factory. 2.Available capital: $10,000,000 3.Cal wants to maximize “total net present value” (profitability vs. time value of money) NPVPrice 1Build a factory in L.A.? $9m$6m 2Build a factory in S.F.?$5m$3m 3Build a warehouse in L.A.?$6m$5m 4Build a warehouse in S.F.?$4m$2m Binary Integer Programming Example: Cal Aircraft Manufacturing Company

12 Cal wants to expand: Build new factory in Los Angeles, San Francisco, both or neither. Build new warehouse (at most one). Warehouse must be built close to the city of a new factory. What decisions are to be made? 1.Build factory in LA 2.Build factory in SFO 3.Build warehouse in LA 4.Build warehouse in SFO 1 if decision i is yes Introduce 4 binary variables x i = 0 if decision i is no Binary Integer Programming Example: Cal Aircraft Manufacturing Company

13 1.Cal wants to expand 2.Available capital: $10,000,000 3.Cal wants to maximize “total net present value” (profitability vs. time value of money) NPVPrice 1Build a factory in L.A.? $9m$6m 2Build a factory in S.F.?$5m$3m 3Build a warehouse in L.A.?$6m$5m 4Build a warehouse in S.F.?$4m$2m What is the objective? Maximize NPV: Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 What are the constraints on capital? Don’t go beyond means: 6x 1 + 3x 2 + 5x 3 + 2x 4 <10 Binary Integer Programming Example: Cal Aircraft Manufacturing Company

14 LA factory(x 1 ), SFO factory(x 2 ), LA warehouse(x 3 ),SFO warehouse (x 4 ) Build new factory in Los Angeles, San Francisco, both or neither. Build new warehouse (at most one). Warehouse must be built close to city of a new factory. What are the constraints between decisions? 1.No more than one warehouse: Most 1 of {x 3, x 4 } x 3 + x 4 < 1 2.Warehouse in LA only if Factory is in LA: x 3 implies x 1 x 3 – x 1 < 0 3.Warehouse in SFO only if Factory is in SFO: x 4 implies x 2 x 4 - x 2 < 0 Binary Integer Programming Example: Cal Aircraft Manufacturing Company

15 Exclusive choices Example: at most 2 decisions in a group can be yes: LP Encoding: x 1 +…+ x k < 2. Encoding Decision Constraints: Logical implications x 1 implies x 2 : (x 1 requires x 2 ) LP Encoding: x 1 - x 2 < 0.

16 LA factory(x1), SFO factory(x2), LA warehouse(x3),SFO warehouse (x4) Build new factory in Los Angeles, San Francisco, or both. Build new warehouse (only one). Warehouse must be built close to city of a new factory. What are the constraints between decisions? 1.No more than one warehouse: Most 1 of {x 3, x 4 } x 3 + x 4 < 1 2.Warehouse in LA only if Factory is in LA: x 3 implies x 1 x 3 – x 1 < 0 3.Warehouse in SFO only if Factory is in SFO: x 4 implies x 2 x 4 - x 2 < 0 Binary Integer Programming Example: Cal Aircraft Manufacturing Company

17 Complete binary integer program: Maximize Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: 6x 1 + 3x 2 + 5x 3 + 2x 4 <10 x 3 + x 4 < 1 x 3 - x 1 < 0 x 4 - x 2 < 0 x j < 1 x j = {0,1}, j=1,2,3,4 x j > 0 Binary Integer Programming Example: Cal Aircraft Manufacturing Company

18 Outline What is Integer Programming (IP)? How do we encode decisions using IP? –Exclusion between choices –Exclusion between constraints How do we solve using Branch and Bound? –Characteristics –Solving Binary IPs –Solving Mixed IPs and LPs

19 Cooperative Vehicle Path Planning

20 Cooperative Path Planning MILP Encoding: Constraints Min J T Receding Horizon Fuel Cost Fn s ij ≤ w ij, etc.State Space Constraints s i +1 = As i + Bu i State Evolution Equation x i ≤ x min + My i1 -x i ≤ -x max + My i2 y i ≤ y min + My i3 Obstacle Avoidance -y i ≤ -y max + My i4  y ik ≤ 3 Similar constraints for Collision Avoidance (for all pairs of vehicles)

21 Cooperative path planning MILP Encoding: Fuel Equation min = J T = min  q’w i +  r’v i + p’w N w i, v i i=1 N-1 i=1 N-1 slack control vectorweighting vectors slack state vector past-horizon terminal cost term total fuel calculated over all time instants i

22 How Do We Encode Obstacles? Each obstacle-vehicle pair represents a disjunctive constraint : Each disjunct is an inequality –let xR, yR be red vehicle’s co-ordinates then: –Left: xR < 3 –Above: R > 4,... Constraints are not limited to rectangular obstacles –(inequalities might include both co-ordinates) May be any polygon –(convex or concave) Red Vehicle is above obstacle OR Red Vehicle is below obstacle OR Red Vehicle is left of obstacle OR Red Vehicle is right of obstacle

23 Example : (x1,x2 real) Either 3x 1 + 2x 2 < 18 Or x + 4x < 16 BIP Encoding: Use Big M to turn-off constraint: Either: 3x 1 + 2x 2 < 18 and x 1 + 4x 2 < 16 + M (and M is very BIG) Or: 3x 1 + 2x 2 < 18 + M and x 1 + 6x 2 < 16 Encoding Exclusion Constraints Use binary y to decide which constraint to turn off: 3x1 + 2x2 < 18 + y M x1 + 2x2 < 16 + (1-y)M y  {0,1}

24 Cooperative Path Planning MILP Encoding: Constraints Min J T Receding Horizon Fuel Cost Fn s ij ≤ w ij, etc.State Space Constraints s i +1 = As i + Bu i State Evolution Equation x i ≤ x min + My i1 -x i ≤ -x max + My i2 y i ≤ y min + My i3 Obstacle Avoidance -y i ≤ -y max + My i4 At least one enabled  y ik ≤ 3At least one enabled Similar constraints for Collision Avoidance (for all pairs of vehicles)

25 K out of N constraints hold: f 1 (x 1, x 2,…x n ) < d 1 OR : f N (x 1, x 2, …, x n ) < d N where f i are linear expressions LP Encoding: Introduce y i to turn off each constraint i: Use Big M to turn-off constraint: f1(x1,..., xn ) < d1 + My1 : fN(x1, …, xn ) < dN + MyN Constrain K of the y i to select constraints: Encoding General Exclusion Constraints At least K of N hold:

26 Function takes on one out of n possible values: a 1 x 1 +... a n x n = [d 1 or d 2 … or d p ] LP Encoding: y i  {0,1} i=1,2,…p  y i = 1 a 1 x 1 +... a n x n =   d i y i Encoding Mappings to Finite Domains

27 Fixed – charge problem: f i (x j ) =| k j + c j x j if x j >0 | 0 if x j =0 Minimizing costs: Minimizing z=f 1 (x 1 ) +---+ f n (x n ) Yes or no decisions: should each of the activities be undertaken? Encoding Constraints Introduce auxiliary variables: y 1, …, y n = 0,1 y = 1 if x > 0 0 if x = 0 Which can be written as a linear constraint using big M: x <yM

28 Outline What is Integer Programming (IP)? How do we encode decisions using IP? –Exclusion between choices –Exclusion between constraints How do we solve using Branch and Bound? –Characteristics –Solving Binary IPs –Solving Mixed IPs and LPs

29 Solving Integer Programs: Characteristics Fewer feasible solutions than LPs. Worst-case exponential in # of variables. Solution time tends to: –Increase with increased # of variables. –Decrease with increased # of constraints. Commercial software: –Cplex

30 Methods To Solve Integer Programs Branch and Bound –Binary Integer Programs –Integer Programs –Mixed Integer (Real) Programs Cutting Planes

31 Branch and Bound Problem: Optimize f(x) subject to A(x) ≥ 0, x  D B & B - an instance of Divide & Conquer: I. Bound D’s solution and compare to alternatives. 1)Bound solution to D quickly. Perform quick check by relaxing hard part of problem and solve.  Relax integer constraints. Relaxation is LP. 2)Use bound to “fathom” (finish) D if possible. a.If relaxed solution is integer, Then keep soln if best found to date (“incumbent”), delete D i b.If relaxed solution is worse than incumbent, Then delete D i. c.If no feasible solution, Then delete D i. II. Otherwise Branch to smaller subproblems 1)Partition D into subproblems D 1 … D n 2)Apply B&B to all subproblems, typically Depth First.

32 B&B for Binary Integer Programs (BIPs) Problem i: Optimize f(x) st A(x) ≥ 0, x k  {0,1}, x  D i Domain D i encoding (for subproblem): partial assignment to x, –{x 1 = 1, x 2 = 0, …} Branch Step: 1.Find variable x j that is unassigned in D i 2.Create two subproblems by splitting D i : D i1  D i  {x j = 1} D i0  D i  {x j = 0} 3.Place on search Queue

33 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: {} Incumbent: none Best cost Z*: - inf Initialize {}

34 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: {} Incumbent: none Best cost Z*: - inf Dequeue {} {}

35 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Bound {} 1. Constrain x i by {} 2. Relax to LP 3. Solve LP Z = 16.5, x = {}

36 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Try to fathom: 1. infeasible? 2. worse than incumbent? 3. integer solution? Z = 16.5, x = {}

37 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Branch: 1. select unassigned x i pick non-integer (x 1 ) 2. Split on x i Z = 16.5, x = {x 1 = 0}{x 1 = 1} {} {x 1 = 0} {x 1 = 1}

38 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Dequeue: depth first or best first {x 1 = 0}{x 1 = 1} {} {x 1 = 0} {x 1 = 1}

39 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Bound {x 1 = 0} constrain x by {x 1 = 0} relax to LP solve {x 1 = 1} {} {x 1 = 0} {x 1 = 1}

40 Example: B&B for BIPs Solve: Max Z = 9 0 + 5x 2 + 6x 3 + 4x 4 Subject to: –6 0 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-0 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Bound {x 1 = 0} constrain x by {x 1 = 0} relax to LP solve {x 1 = 1} {} {x 1 = 0} {x 1 = 1}

41 Example: B&B for BIPs Solve: Max Z = 9 0 + 5x 2 + 6x 3 + 4x 4 Subject to: –6 0 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-0 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf Bound {x 1 = 0} constrain x by {x 1 = 0} relax to LP solve LP {x 1 = 1} {} {x 1 = 0} {x 1 = 1} Z = 19,5, x =

42 Example: B&B for BIPs Solve: Max Z = 9 0 + 5x 2 + 6x 3 + 4x 4 Subject to: –6 0 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-0 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: none Best cost Z*: - inf {x 1 = 1} {} {x 1 = 0} {x 1 = 1} Z = 19,5, x = Try to fathom: 1. infeasible? 2. worse than incumbent? 3. integer solution?

43 Example: B&B for BIPs Solve: Max Z = 9 0 + 5x 2 + 6x 3 + 4x 4 Subject to: –6 0 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-0 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 = 1} {} {x 1 = 0} {x 1 = 1} Z = 19,5, x = Try to fathom: 1. infeasible? 2. worse than incumbent? 3. integer solution?

44 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 = 1} {} {x 1 = 0} {x 1 = 1} Dequeue

45 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} Bound {x 1 = 1}

46 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} Z = 16.2, x = Bound {x 1 = 1}

47 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 = 1} {} {x 1 = 0} {x 1 = 1} Z = 16.2, x = Try to fathom: infeasible? worse than incumbent? integer solution?

48 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 =1, x 2 =1}{x 1 =1, x 2 =0} {} {x 1 = 0} {x 1 = 1} Branch Dequeue {x 2 = 1} {x 2 = 0} Z = 16.2, x =

49 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 =1, x 2 =0} {} {x 1 = 0} {x 1 = 1} Bound {x 1 = 1, x 2 = 1} {x 2 = 1} {x 2 = 0}

50 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {x 1 =1, x 2 =0} {} {x 1 = 0} {x 1 = 1} Z = 16, x = Bound {x 1 = 1, x 2 = 1} {x 2 = 1} {x 2 = 0} Try to fathom: infeasible? worse than incumbent? integer solution?

51 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {…,x 2 =0} {} {x 1 = 0} {x 1 = 1} Branch {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 3 =1}{…,x 3 =0}{…,x 2 =0} Z = 16, x =

52 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} Dequeue Bound {x 1 =1, x 2 =1, x 3 =1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 3 =1} {…,x 3 =0}{…,x 2 =0}

53 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –1 3 + x 4 ≤ 1 –-1 1 + 1 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 3 = 0}{…,x 2 = 0} Bound {x 1 =1, x 2 =1, x 3 =1} Try to fathom: infeasible? No Solution

54 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-x 1 + x 3 ≤ 0 –-x 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 3 = 0}{…,x 2 = 0} Dequeue Bound {x 1 =1, x 2 =1, x 3 =0}

55 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 2 = 0} Z = 16, x = Bound {x 1 =1, x 2 =1, x 3 =0} Try to fathom: infeasible? worse than incumbent? integer solution?

56 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 4 =0}{…,x 4 =1}{…,x 2 =0} Z = 14, x = Branch Dequeue Bound {x 4 = 0} {x 4 = 1} {…,x 2 =0}

57 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} {…,x 4 =1}{…,x 2 =0} Z = 14, x = {x 4 = 0} {x 4 = 1} Try to fathom: infeasible? worse than incumbent? integer solution?

58 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} Z = 14, x = Try to fathom: infeasible? worse than incumbent? integer solution? {x 4 = 0} {x 4 = 1} Incumbent: x = Best cost Z*: 14 {…,x 4 =1}{…,x 2 =0}

59 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + 1 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + 1 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} dequeue & bound No Solution, x = Try to fathom: infeasible? worse than incumbent? integer solution? {x 4 = 0} {x 4 = 1} Incumbent: x = Best cost Z*: 14 {…,x 4 =1}{…,x 2 =0}

60 Example: B&B for BIPs Solve: Max Z = 9x 1 + 5x 2 + 6x 3 + 4x 4 Subject to: –6x 1 + 3x 2 + 5x 3 + 2x 4 ≤ 10 –x 3 + x 4 ≤ 1 –-1 1 + x 3 ≤ 0 –-1 2 + x 4 ≤ 0 –x i ≤ 1, x i ≥ 0, x i integer Queue: Incumbent: x = Best cost Z*: 9 {} {x 1 = 0} {x 1 = 1} {x 2 = 1} {x 2 = 0} {x 3 = 1} {x 3 = 0} dequeue & bound Z = 13.8, x = Try to fathom: infeasible? worse than incumbent? integer solution? {x 4 = 0} {x 4 = 1} Incumbent: x = Best cost Z*: 14 {…,x 2 =0}

61 Integer Programming (IP) What is it? Making decisions with IP –Exclusion between choices –Exclusion between constraints Solutions through branch and bound –Characteristics –Solving Binary IPs –Solving Mixed IPs and LPs

62 Example: B&B for MIPs Max Z = 4x 1 - 2x 2 + 7x 3 - x 4 Subject to: –x 1 + 5x 3 ≤ 10 –x 1 + x 2 - x 3 ≤ 1 –6x 1 + 5x 2 ≤ 0 –-x 1 + 2x 3 – 2x 4 ≤ 3 –x i ≥ 0, x i integer x 1, x 2, x 3, {} {x 1 ≤ 1}{x 1 ≥ 2} {x 2 ≤ 1} {x 2 ≥ 2} {x 1 = 0} {x 1 = 1} Incumbent: Best cost Z*: Z = 14.25, x = Z = 14.2, x = Infeasible, x = x = 13.5 Z = 14 1/6, x = Z = 12 1/6, x = Z = 13.5, x =


Download ppt "Integer Programming and Branch and Bound Brian C. Williams 16.410-13 November 15 th, 17 th, 2004 Adapted from slides by Eric Feron, 16.410, 2002."

Similar presentations


Ads by Google