Download presentation

Presentation is loading. Please wait.

Published byArely Saucerman Modified about 1 year ago

1
ECE Longest Path dual 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality – Longest Path Problem

2
ECE Longest Path dual 2 Linear Program Dual – Example1 Primal LP (original)Primal LP (original) max 100x x 2 s.to: 10x 1 + 5x 2 50 5x 1 + 5x 2 35 5x x 2 80 Primal solution: x 1 =3, x 2 =4, F p = 620 max c T x s.to: A x b x 0 Dual LP (original)Dual LP (original) min 50w w w 3 s.to: 10w 1 + 5w 2 + 5w 3 100 5w 1 + 5w w 3 80 Dual solution: w 1 =4, w 2 =12, w 3 =0 F d = 620 max w T b s.to: w T A c T w 0 w1w1 w2w2 w3w3

3
ECE Longest Path dual 3 Example 2: Longest Path Problem Formulate it as a Linear Program – –Assign variables x i to each edge e i x i = 1 if edge e i is in the longest path x i = 0 otherwise – –Write the objective function – –Write the constraint set x1 x2 x3 x4 x5 x6 x9 x8 x7

4
ECE Longest Path dual 4 Example 2: Longest Path Problem (2) Primal Problem x1 x2 x3 x4 x5 x6 x9 x8 x max 4x1 + 5x2 + 2x3 + 2x4 + 2x5 + 3x6 + 5x7 + 3x8 + 6x9 st - x1 - x2 - x3 = -1 x1 - x4 - x7 = 0 x2 + x4 - x5 = 0 x3 - x6 - x9 = 0 x5 + x6 - x8 = 0 x7 + x8 + x9 = 1 end

5
ECE Longest Path dual 5 Example 2: Longest Path Problem (3) Primal Problem - solution x1 x2 x3 x4 x5 x6 x9 x8 x max 4x1 + 5x2 + 2x3 + 2x4 + 2x5 + 3x6 + 5x7 + 3x8 + 6x9 st - x1 - x2 - x3 = -1 x1 - x4 - x7 = 0 x2 + x4 - x5 = 0 x3 - x6 - x9 = 0 x5 + x6 - x8 = 0 x7 + x8 + x9 = 1 end LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) VARIABLE VALUE REDUCED COST X X X X X X X X X

6
ECE Longest Path dual 6 Example 2: Longest Path Problem (4) Dual Problem formulation + solution min -w1 + w6 st -w1 + w2 > 4 -w1 + w3 > 5 -w1 + w4 > 2 -w2 + w3 > 2 -w3 + w5 > 2 -w4 + w5 > 3 -w2 + w6 > 5 -w5 + w6 > 3 -w4 + w6 > 6 end LP OPTIMUM FOUND AT STEP 7 OBJECTIVE FUNCTION VALUE 1) VARIABLE VALUE REDUCED COST W W W W W W Interpretation of dual variables: w i = distance of node I from source w6= w2=4 w1=0 w4=5 w3=6 w5=8 Note: This is still a longest path problem (Critical Path or Scheduling problem): Find a minimum distance from sink to source that satisfies all edge-length constraints.

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google