You are on page 1of 9

# MS&E 111

Fall 2007 Excel Solver Tutorial The Problem: Consider a knapsack problem like the kind discussed in class (and in the supplementary notes). We have four divisible goods with the weights and values listed below. How much of each good should we place in our knapsack (with capacity 15lbs) to maximize the total value of the contents? Weight 17 11 6 12 15 Value 4 2 6 5

1 2 3 4 capacity:

Goods

## Convert the problem into a standard LP form and solve in Excel.

x 0 0 1 0.75 A 1 0 0 0 17 0 1 0 0 11

c 4 2 6 5

cTx 9.75

Ax 0 0 1 0 6 0 0 0 1 12 0 0 1 0.75 15

b 1 1 1 1 15

The Problem: We have 3 MS&E students and 3 potential advisors. We wish to match students to advisors in such a way that each student has exactly one advisor and each advisor has exactly one student (professors don't like being overworked). However, not all matchings are equivalent- each possible pairing results in a distinct "happiness" level given in the table below. How should we match students and advisors to maximize the total happiness of the members of the department? Advisors 1 1 6 2 7 3 5.5

2 2 9 7.5

3 7.5 8 3

Students

Convert the problem into a standard form LP and solve. Does the problem have any non-integer solutions? Does Excel ever return a non-integer solution?

## c 6 2 7.5 7 9 8 5.5 7.5 3

cTx 22

1 0 0 0 0 1

0 1 0 1 0 0

0 1 0 0 1 0

0 1 0 0 0 1

0 0 1 1 0 0

0 0 1 0 1 0

Note: 1->3, 2->2, 3->1 is also a solution. Excel may give either, but it will never give an intermediate, fractional solution, even though this technically also solves the LP. We'll discuss why this happens later in the course

Ax 0 0 1 0 0 1 1 1 1 1 1 1

b 1 1 1 1 1 1

## Another problem to try on your own (after the tutorial).

The Problem: You are the manager of an employment agency. You have 9 clients looking for employment and 12 potential jobs in which to place them. Each client can only take (at most) one job, and each job can have (at most) one client working on it. Moreover, due to the skills required, each client is only capable of working on some subset of the potential jobs (see the table below). How should you assign clients to jobs to maximize the total number of working clients? Clients (1 := client can do job) 1 2 3 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0

1 2 3 4 5 6 7 8 9 10 11 12

4 0 0 1 0 0 0 0 0 0 1 0 0

5 0 1 0 1 0 1 0 0 0 0 1 0

6 1 0 0 0 0 0 0 0 0 0 0 1

7 1 0 1 0 0 0 1 0 0 0 0 1

8 0 0 1 0 1 0 0 0 1 0 0 1

Jobs

9 0 0 1 0 0 0 1 0 0 0 0 0

x 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1

colsums

Note: Because of the size of the problem, we've kept the decision variables in matrix form, rather than vectorizing everything as we did in the previous problem. When solving matching problems on HW, you may use either approach. Just be sure to understand that any LP can be written in matrix / vector form.

0 0 0 0 0 0 0 0 0 0 0 0 0

rowsums 1 1 1 0 1 0 1 0 1 1 0 1

obj 8