Solution #6

Q1:
a).
When x1>=0 and x2>=0
Obj = -10.1262,
x1 = 1.59223,
When 0<=x1<=1 and x2>=0
Obj = -8.21951,
x1 = 1,
When x1>=2 and x2>=0
x1 = 1,
infeasible
x2 = 1.2439
When 0<=x1<=1 and 0<=x2<=1
Obj = -7,
x2 = 1.38835
When 0<=x1<=1 and x2>=2
infeasible
x2 = 1
b). Using Xpress, the solution is: x1 = 1, x2 = 1, obj = -7
c). Comparison:
Q2:
a) Relax the problem to an assignment problem, its optimal solution can be obtained by
Hungarian method:
1
2
3
4
5
1
X
0
32
0
2
2
0
X
0
6
19
3
0
15
X
11
12
4
38
0
22
X
0
5
36
28
0
0
X
The optimal cells are: (1,2), (2,3), (3,1), (4,5), (5,4).
Obj = 154. There are two sub-tours: 1-2-3-1 and 4-5.
We choose x_31 as the branching variable.
Sub-problem 1: add one constraint into the problem: x31 = 0
Sub-problem 2: add two constraints into the problem: x31 = 1 and x13 = 0
For sub-problem 1: using Hungarian method,
1
2
3
4
1
X
0
0
38
2
0
X
4
0
3
32
0
X
22
4
0
6
0
X
5
2
19
1
0
5
36
28
0
0
X
its optimal cells are: (1,2), (2,1), (3, 4), (4,5), (5,3)
Obj = 154 + 11 = 165.
For sub-problem 2:
1
2
4
5
2
0
X
0
28
3
X
0
22
0
4
0
6
X
0
5
2
19
0
X
Its optimal cells are: (1,2), (2,3), (4,5) (5,4)
Obj = 154.
Thus we choose the variable x23 as branching variables.
There are two sub-problems for sub-problem 2
Sub-problem 2.1: add the following constraints: x31 = 1, x13 = 0 and x23 = 0.
1
2
4
5
2
0
X
0
28
3
X
X
22
0
4
0
0
X
0
5
2
10
0
X
The optimal cells are: (1,2), (2,4), (3,1), (4,5), (5,3)
Obj = 154 + 6 = 160.
Sub-problem 2.2: add the following constraints: x31 = 1, x23 = 1, x12 = 0.
Its optimal cells are: (1,2), (4,5),(5,4)
Thus we choose variable x54 as the branching variable,
There are two sub-problems again, This time, we get the optimal solution as:
x15 = x23 = x31 = x42 = x54 = 1,
Obj = 154 + 2 = 156.
b). Using Xpress, we can get the optimal solution by the cut-set constraints. The optimal
solution is:
LP Solution:
Objective: 156
x15 = x23 = x31 = x42 = x54 = 1, others = 0
c) Comparison:
Q3:
Definition:
n: number of nodes.
set of available color C={1,2, …, n}.
candidate solution: vector x=(x_1, ---, x_n), where x_i=k if node i is colored
with color k, called “coloring”.
feasible solution (coloring): x is feasible if for each edge (i,j) xi <> xj.
neighbor: x and y are neighbors if xi = yi except one coordinate say j.
Initialization:
Generate a feasible coloring (by greedy or other way). Set up temperature T,
cooling ratio r, and let count = 1.
Iteration:
Choose neighbor:
(i) pick jth node, neighbor color set (xj will change).
NC = {colors | color of the neighboring nodes of j}
= {k (color) | xi = k when (i,j) is an edge}.
(2) pick a color from C\NC (feasible coloring is generated).
Evaluate objective:
Accept if less colors needed. Otherwise, accept with probability
P=exp((f(xi) – f(x0))/T), reject with 1-P.
Repeat:
Increase count by 1 and T = rT.
Q4:
Define xj: the days spent on the course cj.
Cj(xj): grade received for the course cj
The optimal principle:
The optimal strategy depends only on the situation after the course ck-1 , but not on the
decisions that lead to this decision.
The recursion:
fk(v): the maximal product of the possible grades obtained for the courses ck+1,… ,cn
v: the days available
f5(v)=1
fk(v)= max { Ck+1(xk+1) * fk+1(v-xk+1)} where xk+1 <=v, k=1,2,3,4,5
Step1:
f4(v)= max { C3(x3) *f3(v-x3)} where x3 <=v, v= 1,2,3,4,5
v
1
2
3
4
5
1
60
60
60
60
60
2
3
4
5
75
75
75
75
85
85
85
95
95
95
100
100
f4(v)
60
75
95
100
100
Step2:
f3(v)= max { C2(x2) * f2(v-x2)} where x2 <=v, v= 2,3,4,…, 9
v
1
2
3
4
1
2
50 * 60
3
50 * 75
65 * 60
4
50 * 85
65 * 75
85 * 60
5
50 * 95
65 * 85
85 * 75
90 * 60
6
50 * 100
65 * 95
85 * 85
90 * 75
7
50 * 100
65 * 100
85 * 95
90 * 85
8
50 * 100
65 * 100
85 * 100
90 * 95
9
50 * 100
65 * 100
85 * 100
90 * 100
Step3:
f2(v)= max { C3(x3) * f3(v-x3)} where x3 <=v, v=3,4,…, 9
v
1
2
3
4
1
2
3
45 * 3000
4
45 * 3900 65 * 3000
5
45 * 5100 65 * 3900 80 * 3000
6
45 * 6375 65 * 5100 80 * 3900 95 * 3000
7
45 * 7225 65 * 6375 80 * 5100 95 * 3900
8
45 * 8075
65 * 7225
80 * 6375
95 * 5100
9
45 * 9025
65 * 8075
80 * 7225
95 * 6375
5
-
95 * 60
95 * 75
95 * 85
95 * 95
5
-
100 *
3000
100 *
3900
100 *
5100
f3(v)
3000
3900
5100
6375
7225
8075
9025
9025
f2(v)
135000
195000
253500
331500
414375
510000
605625
Step4:
f1(v)= max { C2(x2)*f2(v-x2)} where x2 <=v, v=9
v
9
1
40 *
51000
2
50 *
414375
Therefore, x1=2, x2=2, x3=3, x4=2
3
60 *
331500
4
80 *
253500
5
90 *
195000
f1(v)
20718750