1 / 10

Lecture 23 – HW #9

1. 2. 3. 4. 5. 6. Lecture 23 – HW #9. Discrete Optimization Models Problem 11-9 on page 615 Cameras can be placed at intersections to monitor bad drivers. 65. 40. 43. 48. 72. 36. Objective.

Télécharger la présentation

Lecture 23 – HW #9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1 2 3 4 5 6 Lecture 23 – HW #9 • Discrete Optimization Models • Problem 11-9 on page 615 • Cameras can be placed at intersections to monitor bad drivers 65 40 43 48 72 36

  2. Objective • Determine the nodes to place cameras so that every link (road) is monitored and the cost for installation is minimized.

  3. Part A. The AMPL Model • # Problem 9-11 on page 615 • var x1 binary; # x1 = 1 if camera is placed at 1 • # x1 = 0; otherwise • var x2 binary; var x3 binary; var x4 binary; • var x5 binary; var x6 binary; • minimize CostToCover: 40*x1 + 65*x2 + 43*x3 + 48*x4 + 72*x5 +36*x6; • subject to Link1To2: x1 + x2 >= 1; • subject to Link1To4: x1 + x4 >= 1; • subject to Link2To3: x2 + x3 >= 1; • subject to Link2To5: x2 + x5 >= 1; • subject to Link3To5: x3 + x5 >= 1; • subject to Link3To6: x3 + x6 >= 1; • subject to Link4To5: x4 + x5 >= 1; • subject to Link5To6: x5 + x6 >= 1; • solve; • display x1, x2, x3, x4, x5, x6;

  4. Output For Part B • AMPL Version 20020516 Win32 • ampl: model a:A.txt; • CPLEX 8.0.0: optimal integer solution; objective 155 • 3 MIP simplex iterations • 0 branch-and-bound nodes • x1 = 1 • x2 = 0 • x3 = 1 • x4 = 0 • x5 = 1 • x6 = 0 • ampl:

  5. Optimal Solution Part A • Optimal Cost = 155 1 2 3 4 5 6

  6. Part C. • The city is experiencing a severe budget deficit. • We seek to minimize the number of uncovered roads while using at most 2 cameras. • New variables and constraints: • y12 binary; • # y12 = 1 if link (1,2) is uncovered; = 0 otherwise • Constraint: x1 + x2 + y12 > 1

  7. Part C. AMPL Model • # Problem 9-11 on page 615 • var x1 binary; # x1 = 1 if camera is placed at 1 • # x1 = 0; otherwise • var x2 binary; var x3 binary; var x4 binary; • var x5 binary; var x6 binary; • var y12 binary; # y12 = 1 if link (1,2) is not covered • # y12 = 0 if link (1,2) is covered • var y14 binary; • var y23 binary; • var y25 binary; • var y35 binary; • var y36 binary; • var y45 binary; • var y56 binary;

  8. Part C. Model Continued • minimize UnCoveredLinks: • y12 + y14 + y23 + y25 + y35 + y36 + y45 + y56; • subject to Link1To2: x1 + x2 + y12 >= 1; • subject to Link1To4: x1 + x4 + y14 >= 1; • subject to Link2To3: x2 + x3 + y23 >= 1; • subject to Link2To5: x2 + x5 + y25 >= 1; • subject to Link3To5: x3 + x5 + y35 >= 1; • subject to Link3To6: x3 + x6 + y36 >= 1; • subject to Link4To5: x4 + x5 + y45 >= 1; • subject to Link5To6: x5 + x6 + y56 >= 1; • subject to MaxOf2Cameras: x1 + x2 + x3 + x4 + x5 + x6 <= 2; • solve; • display x1, x2, x3, x4, x5, x6; • display y12, y14, y23, y25, y35, y36, y45, y56;

  9. Part C. Output • AMPL Version 20020516 Win32 • ampl: model a:C.txt; • CPLEX 8.0.0: optimal integer solution; objective 2 • 10 MIP simplex iterations • 0 branch-and-bound nodes • x1 = 0 x2 = 0 x3 = 1 • x4 = 0 x5 = 1 x6 = 0 • y12 = 1 y14 = 1 y23 = 0 • y25 = 0 y35 = 0 y36 = 0 • y45 = 0 y56 = 0

  10. Optimal Solution Part A • Optimal Cost = 155 1 2 3 4 5 6

More Related