Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lecture 26 – Problem 11-19 Page 617 Military Problem with Three Commanders Six Radar Stations Each Commander Should Be Assigned Two Radar Stations C1C2C3.

Similar presentations


Presentation on theme: "1 Lecture 26 – Problem 11-19 Page 617 Military Problem with Three Commanders Six Radar Stations Each Commander Should Be Assigned Two Radar Stations C1C2C3."— Presentation transcript:

1 1 Lecture 26 – Problem 11-19 Page 617 Military Problem with Three Commanders Six Radar Stations Each Commander Should Be Assigned Two Radar Stations C1C2C3 S1S2 S3S4S5S6 Cost = 42 MCost = 68 MCost = 47 M

2 2 Another Feasible Assignment C1C2C3 S1S3 S2S5S4S6 Cost = 65 MCost = 40 MCost = 39 M Total Cost For This Assignment is 65+40+39 = 144

3 3 Cost Matrix In 000,000s Symmetrical – See Page 617 123456 1-4265293155 2-20394021 3-685522 4-3039 5-47 6-

4 4 The Data File – See p 617 set N := 1 2 3 4 5 6; param cost := 1 2 42 1 3 65 1 4 29 1 5 31 1 6 55 2 3 20 2 4 39 2 5 40 2 6 21 3 4 68 3 5 55 3 6 22 4 5 30 4 6 39 5 6 47 ;

5 5 AMPL Model – Page 1 set N; # the set of radar stations param cost{N,N} default 0; # cost[i,j] denotes the construction cost for # linking i and j data data26.txt; display N; display cost; set N1; let N1 := N diff {1}; display N1;

6 6 AMPL Model – Page 2 # Since the cost matrix is symmetrical, fill in bottom half for {i in N1} for {j in N: j < i} let cost[i,j] := cost[j,i]; display cost;

7 7 AMPL Model - Page 3 var x{N,N} binary; # x[i,j] = 1, if i and j are a pair # = 0, otherwise subject to OnePerRow {i in N}: sum {j in N: i<>j} x[i,j] = 1; subject to OnePerCol {j in N}: sum {i in N: i<>j} x[i,j] = 1;

8 8 AMPL Model – Page 4 subject to Symmetry {i in N, j in N}: x[i,j] = x[j,i]; minimize TotalCost: sum{i in N, j in N} cost[i,j]*x[i,j]; expand OnePerRow, OnePerCol, Symmetry, TotalCost; solve; display x;

9 9 Output – Page 1 set N := 1 2 3 4 5 6; cost := 1 2 42 1 3 65 1 4 29 1 5 31 1 6 55 2 3 20 2 4 39 2 5 40 2 6 21 3 4 68 3 5 55 3 6 22 4 5 30 4 6 39 5 6 47 ;

10 10 Output – Page 2 set N1 := 2 3 4 5 6; cost [*,*] : 1 2 3 4 5 6 := 1. 42 65 29 31 55 2 42. 20 39 40 21 3 65 20. 68 55 22 4 29 39 68. 30 39 5 31 40 55 30. 47 6 55 21 22 39 47. ;

11 11 Output – Page 3 s.t. OnePerRow[1]: x[1,2] + x[1,3] + x[1,4] + x[1,5] + x[1,6] = 1; s.t. OnePerRow[2]: x[2,1] + x[2,3] + x[2,4] + x[2,5] + x[2,6] = 1; s.t. OnePerRow[3]: x[3,1] + x[3,2] + x[3,4] + x[3,5] + x[3,6] = 1; s.t. OnePerRow[4]: x[4,1] + x[4,2] + x[4,3] + x[4,5] + x[4,6] = 1; s.t. OnePerRow[5]: x[5,1] + x[5,2] + x[5,3] + x[5,4] + x[5,6] = 1; s.t. OnePerRow[6]: x[6,1] + x[6,2] + x[6,3] + x[6,4] + x[6,5] = 1;

12 12 Output – Page 4 s.t. OnePerCol[1]: x[2,1] + x[3,1] + x[4,1] + x[5,1] + x[6,1] = 1; s.t. OnePerCol[2]: x[1,2] + x[3,2] + x[4,2] + x[5,2] + x[6,2] = 1; s.t. OnePerCol[3]: x[1,3] + x[2,3] + x[4,3] + x[5,3] + x[6,3] = 1; s.t. OnePerCol[4]: x[1,4] + x[2,4] + x[3,4] + x[5,4] + x[6,4] = 1; s.t. OnePerCol[5]: x[1,5] + x[2,5] + x[3,5] + x[4,5] + x[6,5] = 1; s.t. OnePerCol[6]: x[1,6] + x[2,6] + x[3,6] + x[4,6] + x[5,6] = 1;

13 13 Output – Page 5 s.t. Symmetry[1,1]: 0 = 0; s.t. Symmetry[1,2]: x[1,2] - x[2,1] = 0; s.t. Symmetry[1,3]: x[1,3] - x[3,1] = 0; s.t. Symmetry[1,4]: x[1,4] - x[4,1] = 0; s.t. Symmetry[1,5]: x[1,5] - x[5,1] = 0; s.t. Symmetry[1,6]: x[1,6] - x[6,1] = 0;

14 14 Output – Page 6 s.t. Symmetry[6,1]: -x[1,6] + x[6,1] = 0; s.t. Symmetry[6,2]: -x[2,6] + x[6,2] = 0; s.t. Symmetry[6,3]: -x[3,6] + x[6,3] = 0; s.t. Symmetry[6,4]: -x[4,6] + x[6,4] = 0; s.t. Symmetry[6,5]: -x[5,6] + x[6,5] = 0; s.t. Symmetry[6,6]: 0 = 0;

15 15 Output – Page 7 minimize TotalCost: 42*x[1,2] + 65*x[1,3] + 29*x[1,4] + 31*x[1,5] + 55*x[1,6] + 42*x[2,1] + 20*x[2,3] + 39*x[2,4] + 40*x[2,5] + 21*x[2,6] + 65*x[3,1] + 20*x[3,2] + 68*x[3,4] + 55*x[3,5] + 22*x[3,6] + 29*x[4,1] +39*x[4,2] + 68*x[4,3] + 30*x[4,5] + 39*x[4,6] + 31*x[5,1] + 40*x[5,2] + 55*x[5,3] + 30*x[5,4] + 47*x[5,6] + 55*x[6,1] + 21*x[6,2] + 22*x[6,3] + 39*x[6,4] + 47*x[6,5];

16 16 Output – Page 8 CPLEX 8.0.0: optimal integer solution; objective 180 8 MIP simplex iterations 0 branch-and-bound nodes x [*,*] : 1 2 3 4 5 6 := 1 0 0 0 0 1 0 2 0 0 1 0 0 0 3 0 1 0 0 0 0 4 0 0 0 0 0 1 5 1 0 0 0 0 0 6 0 0 0 1 0 0 ;

17 17 Optimal Assignment C1C2C3 S1S5 S2S3S4S6 Cost = 31 MCost = 20 MCost = 39 M Total Cost For This Assignment is 31+20+39 = 90 – Why did CPLEX give 180?


Download ppt "1 Lecture 26 – Problem 11-19 Page 617 Military Problem with Three Commanders Six Radar Stations Each Commander Should Be Assigned Two Radar Stations C1C2C3."

Similar presentations


Ads by Google