Solution to Final Exam of Operations Research ( Version A)
Economics and Management School, Wuhan University
Jan. 10, 2017
********************************************************************************
Rules:
1. No electronic device (for either computation or communication) allowed.
2. No (self-prepared) document or paper allowed.
3. No exit of the exam within the rst 30 mins.
4. No allowance for participation of the exam after being late for over 30 mins.
5. All conclusions/deductions need appropriate justications. New variable needs introduction.
********************************************************************************
1
Ex. 1 (15 pts) A manager has a total of 10 employees working on six projects. Three are
overlaps among the assignments as the following table shows:
The manager meets with each employee individually once a week for a progress report. Each
meeting lasts about 20 mins for a total of 3 hours and 20 mins for all 10 employees. To reduce
the total time, the manager now changes the plan and wants to hold sequential group meetings
depending on shared projects. The objective is to schedule the meetings in a way that will reduce
the trac (number of employees) in and out of the meeting room.
Question.
(a) Formulate the problem as a network optimization model.
(b) Without giving explicit solution, explain briey in words (1 or 2 sentences) how can you solve
the above model.
Solution (with details).
The total trac is a sum of the following three components: the initial employees entering
into the meeting room; at each alternation of projects, the employees getting in and out of the
room; the nal employees leaving the room. The rst or the third component of a project i is
just its total number of employees, denoted by Ci .
The second component is calculated as follow. Consider a project j (whose set of employees
is denoted as Ej ) is met immediately after i (whose set of employees is denoted as Ei ), the trac
in and out the room is calculated as cij = |Ei − Ej | + |Ej − Ej |. For example, c23 = 3 + 3 = 6:
2
if Project 3 is discussed after Project 2, there are in total 6 employees (number 1,2,4,7,8,10)
getting in and out of the room, and 3 others (number 2, 5, 6) staying in the room. The following
table gives all the information:
In general, the objective is to choose the sequential projects to meet (each one meet exactly
once) for a minimum trac in and out the room.
[Method 1 (The shortest-path problem)]
(a) (13 pts) We construct the following weighted graph G, which is almost a "tree". Starting
with O, which connects to 1, ..., 6. Then each node proceeds to connect to 5 other nodes for the
rst generation, and then 4 other nodes,..., with the restriction than no repetition occurs on a
path. At the terminal, each node is connected to the termination node T . For example, a typical
path will be "O → 1 → 3 → 5 → 4 → 2 → 6 → T ". The weights are dened as follows: on an
edge connecting O or T with any node representing i, the weight is Ci ; on any node connecting
any two nodes representing i and j , the weight is cij . The network optimization problem is then
dened as looking for a shortest path from O to T .
(b) The shortest-path problem can be solved by the Dijkstra's algorithm ; or we can formulate it
as a BIP, and solve it by a computer program (Excel-SOLVER for example) or by the branch-
and-bound method (with the help of LP relaxation).
[Method 2 (A network optimization on a complete graph)]
(a) Construct a weighted graph G = hV, E, ci as follows:
• V = {O, 1, ..., 6};
• E = {ij|i 6= j, i, j = O, 1, ..., 6};
• h : E → RR+ with h(Oi) = ci and h(ij) = cij .
An example:
3
The optimization problem on the above graph is then to nd a loop (tour) starting from O and
visiting all other nodes once and only once which has a minimum cost.
Note. Alternatively, one can decompose the single node O into O the origin node and T the
terminal node such that we look for a shortest path from O to T with the constraint that all nodes
are visited once.
(b) (2 pts) By looking for an appropriate linear constraint for the condition "all nodes are
visited once", one can formulate the problems as a BIP, and solve it by a computer software
(Excel-SOLVER for example), or by the branch-and-bound method (with the help of LP relax-
ation).
(b') [alternative solution] Another solution method is motivated by Ex 4, using the branch-
and-bound method with the help of shortest-path relaxation (remove the condition "all nodes
are visited once") which is again solved by the Dijkstra's algorithm.
Note. Some students may have misunderstood the problem for a dierent model (for example,
a set-covering problem). In this case, partial points are given if the optimization model is
appropriately designed.
An associated set-covering problem is to choose some projects among the 6 such that all
employees are met with the manager for at least once. The application problem can actually be
solved in this way. Let ti (which needs extra computation) be the duration of the project i's
meeting with the manager. Then the model can be stated as follows. Dene the binary variable
xi for the event "Project i being chosen for meeting": xi = 1 if and only if the meeting with
project i takes place.
4
X
min ti xi
i=1,...,6
≥ 1 − − − − (Employee 1 is covered)
x2 + x4 + x5
≥ 1 − − − − (Employee 2 is covered)
x1 + x3 + x5
≥ 1 − − − − (Employee 3 is covered)
x2 + x3 + x4 + x6
≥ 1 − − − − (Employee 4 is covered)
x3 + x4 + x5
≥ 1 − − − − (Employee 5 is covered)
x1 + x2 + x3
s.t. x1 + x2 + x3 + x4 + x6 ≥ 1 − − − − (Employee 6 is covered)
≥ 1 − − − − (Employee 7 is covered)
x1 + x2 + x5 + x6
≥ 1 − − − − (Employee 8 is covered)
x1 + x3 + x4
≥ 1 − − − − (Employee 9 is covered)
x5 + x6
x1 + x2 + x4 + x5 + x6 ≥ 1 − − − − (Employee 10 is covered)
xi ∈ {0, 1}, i = 1, ..., 6.
Ex. 2 (20 pts + 5 pts of bonus for innovative techniques) Jobco uses a single machine to process
three jobs. Both the processing time and he due date (in days) for each job are given in the
following table. The due dates are measured from time zero, the assumed start time of the rst
job.
The objective of the problem is to determine the minimum late-penalty sequence for processing
the three jobs.
Question. Dene appropriate decision variables and formulate this problem as an integer
programming problem (IP).
Solution.
[Method 1] It is always optimal for the single machine to process one job and another. Let
xi be the starting date of job i, i = 1, 2, 3. Two jobs i and j with processing time pi and pj
will not be processed concurrently (at the same time; one after another) if either "xi ≥ xj + pj "
or "xj ≥ xi + pi ". Motivated by this constraint, we introduce yij the auxiliary binary variable
concerning the event "Job i is processed before Job j ", i, j = 1, 2, 3, i 6= j . For M suciently
large, [either "xi ≥ xj + pj " or "xj ≥ xi + pi "] is equivalent to ["M yij + (xi − xj ) ≥ pj " or
"M (1 − yij ) + (xj − xi ) ≥ pi "].
Let dj be the due date of Job j . We introduce the unconstrained variable sj as the gap
between the due date and the realized termination date, i.e. xj + pj + sj = dj . If sj ≥ 0, the
5
due date is met, and if sj < 0, a late penalty applies. We set sj = s−
j − sj with sj , sj ≥ 0. The
+ − +
MIP model for the given problem is (all variables take integer values)
[Method 2] Let xij be the binary variable concerning the event "Job i is processed rst,
then Job j the second, and the third the last", i, j = 1, 2, 3, i 6= j . For example x23 means Job
2 is the rst to be settled, then Job 3 and nally Job 1. There are in total only 6 possibilities
(combinations) 12, 13, 21, 23, 31, 32, so we can compute in each case the late-penalty cost cij . For
example, c12 = 206$. So a BIP can be formulated as follow to solve the problem (it is equivalent
to choose the minimum cost among all "cij "):
X
min z = xij cij
i,j=1,2,3
(P
i,j=1,2,3 xij =1
s.t.
xij ∈ {0, 1}.
Note. It is also possible to dene the binary variable xijk concerning the event "Job i is processed
rst, then Job j the second, and the Job k the third", i, j, k = 1, 2, 3, i 6= j 6= k. This is equivalent
to the above dened "xij " since there are in total only 3 jobs.
[Method 3] Let zij be the binary variable with the Job i processed in order j . Then it is
possible to obtain the variables in [Method 2] as follows: xij = zi1 zj2 . The constraints are then
" i=1,2,3 zij = 1 for each j " and " j=1,2,3 zij = 1 for each i". The problem with this method
P P
is that the obtained objective function is non-linear. Nevertheless, we can use the broader sense
of IP, i.e. the objective function needs not be linear.
[Method 4] This method does not ask the machine to process another job after nishing
the previous. Even though optimal solutions can always be taken in this form. Let the binary
variable yij concerning the event "Job i being processed in date j ", i = 1, 2, 3 and j = 1, ..., 40
(40 is the total processing date). Late-penalty for Job 1 occurs only if "x1j = 1 and j ≥ di = 25".
6
Same for Job 2 and Job 3. The optimization problem can be formulated as the following BIP:
40
X 40
X 40
X
min z = 19 x1j + 19 x2j + 34 x3j
j=26 j=23 j=36
P40
Pj=1 x1j = 5
40
Pj=1 x2j = 20
40
s.t. j=1 x3j = 15
x1j + x2j + x3j = 1, ∀j = 1, ..., 40.
xij ∈ {0, 1}.
Ex. 3 (35 pts + 5 pts of bonus) Consider the following Minimum Cost Flow Problem. The
→
− → − → − → −
initial basic solution X corresponds to the minimum spanning tree T = {12, 23, 34, 45}, and with
→
− →− →
− → − → −
the non-basic variables {13, 24} reaching the upper bound capacities, {25, 53, 35} reaching the
lower bound capacities.
Question.
a. Write out the value of X and show that it is not a BF solution.
b. Find a BF solution Y adjacent to X by shifting one non-basic variable's value from reaching
the lower bound to reaching the upper bound.
c. Solve for one optimal solution to the problem using the network simplex method with the BF
solution obtained in Question b.
d. Are there multiple optimal solutions? If yes, write an alternative one and give necessary
computation details showing what method you are using to obtain it.
Solution.
(a) (10 pts) For (x13 , x24 ) = (8, 4) and (x25 , x53 , x35 ) = (0, 0, 0), the following system should
be satised for balance at each node:
x12 + x13 = 20 − − − node 1
−x12 + x23 + x24 + x25 = 0 − − − node 2
−x13 − x23 − x53 + x34 + x35 = 0 − − − node 3
−x24 − x34 + x45 = −5 − − − node 4
−x25 − x35 − x45 + x53 = −15 − − − node 5
7
Solving the above equations, we obtain (x12 , x23 , x34 , x45 ) = (12, 8, 16, 15). X is not feasible
→
−
because x34 = 16 which is above u34 = 15 the upper bound capacity of the edge 34.
→
−
(b) (10 pts) By shifting 35 from its lower bound capacity 0 to its upper bound capacity 5,
we solve the balance system again to obtain the basic solution Y: x12 = 12, x23 = 8, x34 = 11,
x45 = 10 (basic), x25 = x53 = 0 (non-basic, lower bound), and x13 = 8, x24 = 4, x35 = 5
(non-basic, upper bound). Y is feasible thus a BF solution. Moreover, the minimum cost is 150$
by computation.
(c) (10 pts) We verify that indeed Y is optimal. The details are as follows. We introduce the
multipliers yi for all nodes i , and solve the following system to identify their values (choose an
i to set yi = 2 arbitrarily, say y1 = 0 ):
→
−
c12 =0: y1 − y2 = c12 =4 −−− basic arc 12
→
−
basic arc 23
c
23 =0: y2 − y3 = c23 =2 −−−
→
−
c34 =0: y3 − y4 = c34 =1 −−− basic arc 34
→
−
basic arc 45.
c
45 =0: y4 − y5 = c45 =2 −−−
We have: y1 = 0, y2 = −4, y3 = −6, y4 = −7, y5 = −9.
Next we check the optimality:
→
−
c25 = 6 − y2 + y5 = 1 > 0, okey − − − non-basic arc, lower bound
(
25
→
−
c53 = 1 − y5 + y3 = 4 > 0, okey − − − non-basic arc, lower bound 53
→
−
−c13 = −(6 − y1 + y3 ) = 2 > 0, okey − − − non-basic arc, upper bound 13
→
−
−c24 = −(1 − y2 + y4 ) = 1 > 0, okey − − − non-basic arc, upper bound 24
→
−
−c35 = −(1 − y3 + y5 ) = 0 ≥ 0, okey − − − non-basic arc, upper bound 35
This implies the current BF solution Y is indeed optimal.
(d) (5 pts + 5 pts of bonus for complete computation details) In solving Question (c), we
→
−
nd that c35 = 0, thus there is multiple optimal solutions. We choose 35 as the entering variable
(arc), so
11+θ 4−θ 10+θ
”4 ←−−− 3 −−→ 5 ←−−− 4”
forms a loop, where θ ≥ 0 is the incremental unit on it. The boundary conditions on θ are
11 + θ ≤ 15
5 − θ ≥ 15
10 + θ < +∞
→
−
thus θ∗ = 4 and 34 is the leaving variable (arc).
8
We obtain that an alternative optimal solution is x12 = 12, x23 = 8, x35 = 1, x45 = 14 (basic),
x13 = 8, x24 = 4, x34 = 15 (upper bound, non-basic), and x25 = x53 = 0 (lower bound, non-
basic). Indeed, we verify that the cost is still 150$ (optimal).
Ex. 4 (30 pts + 10 pts of bonus) (Solving Travelling Salesman Problem by Branch-
and-Bound Algorithm) The Travelling Salesman Problem (TSP) deals with the following
situation. There are n cities connected by routes. A salesman needs to visit each city exactly
once. He chooses a starting city and then the others to visit one after another, and nally comes
back to the original one after having visited all cities. The travelling orbit satisfying the above
condition is called a tour (or, a loop). The objective is to minimize the total travelling distance
by looking for a tour.
Here is an Example-1:
The tour "D → E → B → F → C → A → D" has a total distance 14+26+15+18+29+31 = 133.
We rst model the TSP as a BIP problem and then develop a method to solve it by the
Branch-and-Bound Algorithm (B&B ). Dene the binary variable
1, if city j is visited immediatly after city i
(
xij =
0, otherwise
Given that dij is the distance connecting city i and j , the TSP model is given as:
n X
n
dij xij , where dij is set as + ∞ for i = j or (i, j) is not connected,
X
min z =
i−1 j=1
P
j=1 xij = 1, i= 1,2,...,n
n
−−− (1)
n x = 1, j= 1,2,...,n
P
−−− (2)
i=1 ij
s.t.
xij ∈ {0, 1}, i, j= 1,2,...,n
−−− (3)
Solution forms an n-city tour
−−− (4)
Note. Constraint (4) can be re-stated by a linear (in)equality, yet its specic form is complicate
and irrelevant, thus omitted here.
Question.
(a)(A-relaxation of TSP) Consider the A-relaxation of the above dened BIP for TSP model
9
without one constraint.
a-1 Please specify which constraint among (1-4) should be discarded in the A-relaxation model
such that "A → F → A; B → C → E → D → B " corresponds to a feasible solution to the
A-relaxation but not the TSP model of Example-1.
a-2 Following Question a-1. In this circumstance, what specic optimization model does the
A-relaxation model correspond to? Please explain briey how the relaxed feasible solution
"A → F → A; B → C → E → D → B " can be interpreted as a solution to this optimization
model.
(b) (B&B Algorithm for TSP) Now we consider another Example-2 of 4-city TSP, with its
data summarized as follows:
∞ 10 3 6
5 ∞ 5 4
(dij ) =
4 9 ∞ 7
7 1 3 ∞
b-1 Solve the A-relaxation model of Example-2. (Please give necessary details to show which
algorithm/method you are using to obtain the solution.)
b-2 Use the B&B Algorithm to solve Example-2. (For a complete solution, you need to nd the
optimal solution to each A-relaxed sub-problem, to indicate why the sub-problem is fathomed
or branched, and to draw the nal branching tree. For all A-relaxed sub-problems except for the
whole one in Question b-1, you may write out directly the optimal solution to the sub-problems
without details of the algorithm being used.)
(Hint : The branching variable is chosen according to the following exemplied criterion.
Suppose that the optimal solution for the A-relaxation model is "xab = xba = xcd = xdc = 1,
other xij = 0", written as (a-b)(c-d), then the branching variable is chosen as the edge (a,b),
and the two branched sub-problems are dened by "xab = 0" and "xba = 0" respectively.)
Solution. (a) a-1 (10 pts). Constraint (4) should be discarded because the feasible solution
associated with "A → F → A; B → C → E → D → B " does not form a tour.
a-2 (10 pts). The relaxed model corresponds to an Assignment Problem. The assignment
corresponding to "A → F → A; B → C → E → D → B " is "(A → F ); (B → C); (C →
E); (D → B); (E → D); (F → A)".
(b) b-1 (10 pts). To solve the A-relaxation model of Example-2, we use the Hungarian
Algorithm to solve the assignment problem with the cost matrix (dij ), to obtain the optimal
solution "a → c → a; b → d → b" and the minimum cost 3 + 4 + 4 + 1 = 12. Indeed, after
subtracting rstly the minimum element in each line of (dij ), and secondly the minimum element
in each column (of the new cost matrix), we obtain the reduced cost matrix
∞ 7 0 6
1 ∞ 1 0
(dij ) =
0 5 ∞ 3
6 0 2 ∞
We nd that the minimum number of column/line to cover all zeros in (dij ) is 4 the capacity
of the assignment problem. Thus it is now "optimal", and the optimal assignment derived from
(dij ) is: a → c; c → a; b → d; d → b.
10
b-2 (10 pts of bonus). We use the B&B Algorithm to solve Example-2. To do this, we rst
notice that the "all" problem (TSP model) needs to be branched because the optimal solution
to its A-relaxation model is not feasible, i.e. "a → c → a; b → d → b" does not form a tour.
The two sub-problems are dened by:
• x13=0 . Its A-relaxation model can be represented as an assignment problem with a cost
matrix
∞ 10 ∞ 6
5 ∞ 5 4
(dij ) =
4 9 ∞
7
7 1 3 ∞
Using the Hungarian Algorithm to solve the above problem, we obtain the optimal solution
"a → d → b → c → a" and the optimal value equal to 6 + 1 + 5 + 4 = 16. The solution
forms a tour, thus this sub-problem is fathomed and the incumbent value is updated as
Z ∗ = 16.
• x31=0 . Its A-relaxation model can be represented as an assignment problem with a cost
matrix
∞ 10 3 6
5 ∞ 5 4
(dij ) =
∞ 9 ∞
7
7 1 3 ∞
Using the Hungarian Algorithm to solve the above problem, we obtain the optimal solution
"a → c → d → b → a" and the optimal value equal to 3 + 7 + 1 + 5 = 16. The solution
forms a tour, thus this sub-problem is fathomed.
We conclude that both "a → d → b → c → a" and "a → c → d → b → a" are optimal
solutions to the TSP problem and the optimal value is 16.
11