Problem Set 3 for Econ 172A, Fall 2007: Knapsack Problem and Assignment Problem Solutions, Assignments of Operational Research

Instructions and problems for econ 172a, fall 2007, problem set 3. The problems involve solving the knapsack problem using branch and bound technique, finding optimal values of capacity c for each item, formulating the knapsack problem as a linear integer programming problem, and solving the assignment problem using the hungarian method with integer constraints. The document also includes a table for missile silos and a network diagram.

Typology: Assignments

Pre 2010

Uploaded on 03/28/2010

koofers-user-cu7
koofers-user-cu7 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Econ 172A, Fall 2007: Problem Set 3
Instructions: Due: December 4, 2007.
1. Consider the knapsack problem in which there are six items with weights wi= 10ifor i=
1, . . . , 6 (that is, the weights are 10, 20, 30, 40, 50, and 60) and values vi= (9 + i)i(that is,
the values are 10, 22, 36, 52, 70, and 90 respectively).
(a) Use the branch and bound technique to solve and your capacity Cis 100. You may use
excel to solve the problem without integer constraints in order to obtain upper bounds
on your value.
(b) Find values of C100 such that it is optimal to put item iin the sack. (You may need
a different value of Cfor each item.)
(c) Formulate the knapsack problem as a linear integer programming problem (the general
formulation is available in your notes). Use excel to solve the specific problem of part (a)
and check your answer. To do this, follow the steps you used to solve linear programming
problems in the previous assignments, with one change. When you enter the constraints
(by clicking on the “tools” menu and selecting “solver”), add the restriction that the
variables are integer. You do this by clicking add constraint, selecting the variables and
pulling down “int” from the middle cell (where in the past you selected either or ).
Notice that you also have the option to select “bin,” doing so will automatically restrict
variables to take on the value of either zero or one.
(d) Solve the problem with the weights and values of part a, but for all weights between 10
and 210 (in increments of 10). Clearly increasing the capacity of the knapsack does not
decrease the value of the problem. Is there anything else you can say about the how
the solution and value vary with C? In particular, if it is optimal to carry the heaviest
item for some C, will it be optimal to carry it for all C0> C ? Is the marginal value
of additional capacity always increasing (increasing returns to scale), always decreasing
(decreasing returns to scale), or neither?
2. Return to problem 3 from the first problem set. Resolve the problem, but add an integer
constraint. Use the spreadsheet posted with my answers, so all you need to do is add the
integer constraint in the solver box. Discuss how the solution changes.
3. The table below gives costs for an assignment problem. Solve the cost minimization and cost
maximization problems using Excel and the Hungarian method. (This means that you must
solve two different problems and solve both of them two different ways.) Clearly indicate the
optimal assignments and value.
1 2 3 4 5 6
A8 7 2 5 100 110
B6 3 8 10 90 110
C4 7 9 9 90 120
D8 10 8 1 85 75
E90 85 95 70 85 125
F80 40 100 80 90 110
4. The table below gives the distances between pairs of missle silos in Utah. The government is
laying cables between the six silos so that any one silo can communicate with any other. What
connections should be made to minimize the total cable length (subject to all towers being
connected)?
1
pf2

Partial preview of the text

Download Problem Set 3 for Econ 172A, Fall 2007: Knapsack Problem and Assignment Problem Solutions and more Assignments Operational Research in PDF only on Docsity!

Econ 172A, Fall 2007: Problem Set 3

Instructions: Due: December 4, 2007.

  1. Consider the knapsack problem in which there are six items with weights wi = 10i for i = 1 ,... , 6 (that is, the weights are 10, 20, 30, 40, 50, and 60) and values vi = (9 + i)i (that is, the values are 10, 22, 36, 52, 70, and 90 respectively).

(a) Use the branch and bound technique to solve and your capacity C is 100. You may use excel to solve the problem without integer constraints in order to obtain upper bounds on your value. (b) Find values of C ≤ 100 such that it is optimal to put item i in the sack. (You may need a different value of C for each item.) (c) Formulate the knapsack problem as a linear integer programming problem (the general formulation is available in your notes). Use excel to solve the specific problem of part (a) and check your answer. To do this, follow the steps you used to solve linear programming problems in the previous assignments, with one change. When you enter the constraints (by clicking on the “tools” menu and selecting “solver”), add the restriction that the variables are integer. You do this by clicking add constraint, selecting the variables and pulling down “int” from the middle cell (where in the past you selected either ≥ or ≤). Notice that you also have the option to select “bin,” doing so will automatically restrict variables to take on the value of either zero or one. (d) Solve the problem with the weights and values of part a, but for all weights between 10 and 210 (in increments of 10). Clearly increasing the capacity of the knapsack does not decrease the value of the problem. Is there anything else you can say about the how the solution and value vary with C? In particular, if it is optimal to carry the heaviest item for some C, will it be optimal to carry it for all C′^ > C? Is the marginal value of additional capacity always increasing (increasing returns to scale), always decreasing (decreasing returns to scale), or neither?

  1. Return to problem 3 from the first problem set. Resolve the problem, but add an integer constraint. Use the spreadsheet posted with my answers, so all you need to do is add the integer constraint in the solver box. Discuss how the solution changes.
  2. The table below gives costs for an assignment problem. Solve the cost minimization and cost maximization problems using Excel and the Hungarian method. (This means that you must solve two different problems and solve both of them two different ways.) Clearly indicate the optimal assignments and value.

A 8 7 2 5 100 110

B 6 3 8 10 90 110

C 4 7 9 9 90 120

D 8 10 8 1 85 75

E 90 85 95 70 85 125

F 80 40 100 80 90 110

  1. The table below gives the distances between pairs of missle silos in Utah. The government is laying cables between the six silos so that any one silo can communicate with any other. What connections should be made to minimize the total cable length (subject to all towers being connected)?

From Tower To Tower 1 2 3 4 5 6 1 15 14 35 32 25 2 15 20 23 22 25 3 14 20 30 26 21 4 35 23 30 13 22 5 32 22 26 13 18 6 25 25 21 22 18

  1. Consider the network below. The number on each arc represents the associated cost. Where an arrowhead appears on both ends of an arc, the cost shown applies to each of the two directions (for example, the cost of a direct trip from (6) to (4) is equal to the cost of a direct trip from (4) to (6) – and both are equal to one). Where no directed arc connecting nodes (i) and (j) appears, it is impossible to go directly from (i) to (j) (for example, it is impossible to go directly from (2) to (5) although the cost of a direct trip from (5) to (2) is eight). Find the shortest route from each node to node 1.

2 x x qqqqqqqqqqqqq 3

  

8

O O

W W

3

 ^3

18

O O

14

^ A^ A

5

q^ q^88 qqq qqq qqq qq 1 SS S ) )

SSSS

SSSS

SSSS

SSSS

S    4

5

O O

1

^ ^ >>