lecture 23 – hw #9

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

Upload: libby-roberts

Post on 31-Dec-2015

32 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture 23 – HW #9

1

Lecture 23 – HW #9

Discrete Optimization ModelsProblem 11-9 on page 615Cameras can be placed at intersections to monitor

bad drivers

1

4 5

2

6

340

6543

48 72 36

Page 2: Lecture 23 – HW #9

2

Objective

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

Page 3: Lecture 23 – HW #9

3

Part A. The AMPL Model

# Problem 9-11 on page 615var x1 binary; # x1 = 1 if camera is placed at 1 # x1 = 0; otherwisevar 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;

Page 4: Lecture 23 – HW #9

4

Output For Part B

AMPL Version 20020516 Win32ampl: model a:A.txt;CPLEX 8.0.0: optimal integer solution; objective 1553 MIP simplex iterations0 branch-and-bound nodesx1 = 1x2 = 0x3 = 1x4 = 0x5 = 1x6 = 0

ampl:

Page 5: Lecture 23 – HW #9

5

Optimal Solution Part A

Optimal Cost = 155

1

4 5

2

6

3

Page 6: Lecture 23 – HW #9

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

Page 7: Lecture 23 – HW #9

7

Part C. AMPL Model

# Problem 9-11 on page 615var x1 binary; # x1 = 1 if camera is placed at 1 # x1 = 0; otherwisevar 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 coveredvar y14 binary;var y23 binary;var y25 binary;var y35 binary;var y36 binary;var y45 binary;var y56 binary;

Page 8: Lecture 23 – HW #9

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;

Page 9: Lecture 23 – HW #9

9

Part C. Output

AMPL Version 20020516 Win32ampl: model a:C.txt;CPLEX 8.0.0: optimal integer solution; objective 210 MIP simplex iterations0 branch-and-bound nodesx1 = 0 x2 = 0 x3 = 1x4 = 0 x5 = 1 x6 = 0

y12 = 1 y14 = 1y23 = 0y25 = 0 y35 = 0y36 = 0y45 = 0 y56 = 0

Page 10: Lecture 23 – HW #9

10

Optimal Solution Part A

Optimal Cost = 155

1

4 5

2

6

3