0% found this document useful (0 votes)
19 views3 pages

Misc PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Misc PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment Problem

The coach of a swim team needs to assign swimmers to a 200-yard medley relay team (four swim-
mers, each swims 50 yards of one of the four strokes). Since most of the best swimmers are very
fast in more than one stroke, it is not clear which swimmer should be assigned to each of the four
strokes. The five fastest swimmers and their best times (in seconds) they have achieved in each of
the strokes (for 50 yards) are:

Backstroke Breaststroke Butterfly Freestyle


Carl 37.7 43.4 33.3 29.2
Chris 32.9 33.1 28.5 26.4
David 33.8 42.2 38.9 29.6
Tony 37.0 34.7 30.4 28.5
Ken 34.4 41.8 32.8 31.1

Table 1: Caption

How should the swimmers be assigned to make the fastest relay team?
Solution: First we define our variables. We will use the table set up above to define our input and
variables. For swimmer in row i of the table and column j, we have their time tij which denotes the
fastest time that swimmer in row i takes while swimming stroke in column j. For example, Carl
is in row 1, and backstroke is column 1, so Carl’s time for backstroke is t11 = 37.7 seconds. Carl’s
time for freestyle is t14 = 29.2 seconds, and so on. These are the inputs given by the problem.
We need to assign a swimmer to each of the strokes and we use the following decision variable
definition: (
1 if swimmer in row i was assigned to stroke in column j
xij =
0 otherwise
You may also decide to give indices for each swimmer and stroke and avoid saying in row and in
column. That is, you may decided Carl = 1, Chris = 2, etc., and backstroke = 1, breaststroke =
2, etc.
Next we write the objective function:
XX
min tij xij
xij
i j

This is the sum of the product of each swimmer’s time and assignment to each stroke. Because
our decision variables are binary, we want to pick the best assignment that results in the minimum
time to finish the relay. This is done through the following nine constraints.
• Each stroke needs to be assigned to exactly one swimmer
5
X
xij = 1 for each stroke j = 1, 2, 3, 4
i=1

• Each swimmer is assigned to one stroke at most


4
X
xij ≤ 1 for each swimmer i = 1, 2, 3, 4, 5
j=1

1
Session #4 Page 13
Formulating Linear Programming Models

Spreadsheet Model for LP Example #4

A B C D E F G H I
1 An Assignment Problem
2
3 Best Times Backstroke Breastroke Butterfly Freestyle
4 Carl 37.7 43.4 33.3 29.2
5 Chris 32.9 33.1 28.5 26.4
6 David 33.8 42.2 38.9 29.6
7 Tony 37.0 34.7 30.4 28.5
8 Ken 34.4 41.8 33.6 31.1
9
10
11 Assignment Backstroke Breastroke Butterfly Freestyle
12 Carl 0 0 0 1 1 <= 1
13 Chris 0 0 1 0 1 <= 1
14 David 1 0 0 0 1 <= 1
15 Tony 0 1 0 0 1 <= 1
16 Ken 0 0 0 0 0 <= 1
17 1 1 1 1
18 = = = = Time
19 1 1 1 1 126.2

B C D E F G H I
3 Best Times Backstroke Breastroke Butterfly Freestyle
4 Carl 37.7 43.4 33.3 29.2
5 Chris 32.9 33.1 28.5 26.4
6 David 33.8 42.2 38.9 29.6
7 Tony 37 34.7 30.4 28.5
8 Ken 34.4 41.8 33.6 31.1
9
10
11 Assignment Backstroke Breastroke Butterfly Freestyle
12 Carl 0 0 0 1 =SUM(C12:F12) <= 1
13 Chris 0 0 1 0 =SUM(C13:F13) <= 1
14 David 1 0 0 0 =SUM(C14:F14) <= 1
15 Tony 0 1 0 0 =SUM(C15:F15) <= 1
16 Ken 0 0 0 0 =SUM(C16:F16) <= 1
17 =SUM(C12:C16) =SUM(D12:D16) =SUM(E12:E16) =SUM(F12:F16)
18 = = = = Time
19 1 1 1 1 =SUMPRODUCT(C4:F8,C12:F16)

2
District Assignment: Governor Jerry Mander of the state of Texis is attempting to get the state
legislator to gerrymander Texis’s congressional districts. The state consists of ten cities, and the
numbers of registered Republicans and Democrats (in thousands) in each city are shown below:

City Republicans Democrats


1 80 34
2 60 44
3 40 44
4 20 24
5 40 114
6 40 64
7 70 14
8 50 44
9 70 54
10 70 64

Texis has five congressional representatives. To form congressional districts, cities must be grouped
together according to the following restrictions:

• All voters in a city must be in the same district.

• Each district must contain between 150,000 and 250,000 voters (there are no independent
voters).

Governor Mander is a Republican. Assume that each voter always votes a straight party ticket.
Write a report for Governor Mander to include the following information.

1. Formulate and solve an optimization problem to help Governor Mander maximize the number
of Republicans who will win congressional seats.

2. Solve the problem above, but maximizing the number of seats that Democrats can win.

3. Perform sensitivity analysis by considering different scenarios such as population changes or


party switches. Identify some cases of when such scenarios affect the solutions to the optimal
district allocations above. For example, the population of Republicans in each city could drop
by up to XXX without decreasing the maximum number of districts Republicans can win.

You might also like