60 likes | 77 Views
Explore linear programming duality in the longest path problem for VLSI CAD applications. Formulate primal and dual LP, analyze solutions, and interpret results.
E N D
ECE 665Spring 2005Computer AlgorithmswithApplications to VLSI CAD Linear Programming Duality – Longest Path Problem
w1 w2 w3 Linear Program Dual – Example1 • Primal LP (original) max100x1 + 80x2 s.to: 10x1 + 5x2 50 5x1 + 5x2 35 5x1 + 15x2 80 Primal solution: x1=3, x2 =4, Fp = 620 maxcT x s.to: A x b x 0 • Dual LP (original) • min50w1 + 35w2 + 80w3 • s.to: • 10w1 + 5w2 + 5w3 100 • 5w1 + 5w2 + 15w3 80 • Dual solution: • w1=4, w2 =12, w3=0 • Fd = 620 • maxwT b • s.to:wTA cT • w 0 ECE 665 - Longest Path dual
Formulate it as a Linear Program Assign variables xi to each edge ei xi = 1 if edge eiis in the longest path xi = 0 otherwise Write the objective function Write the constraint set x1 x3 x2 x4 x6 x5 4 2 x7 5 x9 2 x8 1 2 3 2 5 3 3 6 5 4 6 Example 2: Longest Path Problem ECE 665 - Longest Path dual
Primal Problem x1 x3 4 2 x2 5 x4 2 x6 x5 3 2 x7 x9 5 x8 3 1 2 6 3 6 5 4 Example 2: Longest Path Problem (2) 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 ECE 665 - Longest Path dual
Primal Problem - solution x1 max 4x1 + 5x2 + 2x3 + 2x4 + 2x5 + 3x6 + 5x7 + 3x8 + 6x9 x3 st x2 -x1 - x2 - x3 = -1 x1 - x4 - x7 = 0 x4 x2 + x4 - x5 = 0 x3 - x6 - x9 = 0 x5 + x6 - x8 = 0 x6 x5 4 x7 + x8 + x9 = 1 end 2 x7 5 LP OPTIMUM FOUND AT STEP 2 x9 2 x8 1 2 OBJECTIVE FUNCTION VALUE 3 1) 11.000000 2 VARIABLE VALUE REDUCED COST X1 1.000000 0.000000 5 X2 0.000000 1.000000 3 3 4 6 5 6 X3 0.000000 0.000000 X4 1.000000 0.000000 X5 1.000000 0.000000 X6 0.000000 3.000000 X7 0.000000 2.000000 X8 1.000000 0.000000 X9 0.000000 3.000000 Example 2: Longest Path Problem (3) ECE 665 - Longest Path dual
Dual Problem formulation + solution w1=0 min -w1 + w6 4 w2=4 2 st 5 -w1 + w2 > 4 w4=5 -w1 + w3 > 5 2 -w1 + w4 > 2 w3=6 -w2 + w3 > 2 -w3 + w5 > 2 3 2 -w4 + w5 > 3 -w2 + w6 > 5 w5=8 -w5 + w6 > 3 5 -w4 + w6 > 6 3 1 2 6 end LP OPTIMUM FOUND AT STEP 7 w6=11 OBJECTIVE FUNCTION VALUE 1) 11.000000 3 6 5 4 VARIABLE VALUE REDUCED COST W1 0.000000 0.000000 W2 4.000000 0.000000 W3 6.000000 0.000000 W4 5.000000 0.000000 W5 8.000000 0.000000 W6 11.000000 0.000000 Example 2: Longest Path Problem (4) Interpretation of dual variables: wi = distance ofnodeI from source Note: This is still a longest path problem (Critical Path or Schedulingproblem): Find a minimumdistance from sink to source that satisfies all edge-length constraints. ECE 665 - Longest Path dual