Sie sind auf Seite 1von 9

MS&E 111

Fall 2007
Excel Solver Tutorial

Goods

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?

1
2
3
4
capacity:

Weight
17
11
6
12

Value
4
2
6
5

15

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

c
0
0
1
0.75

cTx
4
2
6
5

9.75

Ax
1
0
0
0
17

0
1
0
0
11

0
0
1
0
6

0
0
0
1
12

b
0
0
1
0.75
15

1
1
1
1
15

Students

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

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?

x
x11
x12
x13
x21
x22
x23
x31
x32
x33

c
0
0
1
1
0
0
0
1
0

cTx
6
2
7.5
7
9
8
5.5
7.5
3

22

A
1
0
0
1
0
0

1
0
0
0
1
0

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

0
0
1
0
0
1

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

b
1
1
1
1
1
1

1
1
1
1
1
1

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

Jobs

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?

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

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

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

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

colsums

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

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

Das könnte Ihnen auch gefallen