Добавил:
ivanov666
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Fundamentals of Operations Research. A textbook
.pdf
Branch and Bound
{1,4} {2,3}
LB = 163
{1,4,3} {}
LB = 177
{1,4} {2}
LB = 154
{1,4,2} {}
LB = 160
{1} {2,3,4}{1,4} {}
LB = 154
LB = 162
{1} {2,3}
LB = 154
{1,3} {2}{1,3,2} {}
LB = 164
LB = 160
{1,3} {}
LB = 154
x1= (1, 3, 5, 4, 2, 1)
f1= 160
{1} {2}
LB = 154
{1,2} {}
LB = 175
{1} {}
LB = 154
x0= (1, 3, 2, 5, 4, 1)
f0= 164
61
Figure 5.1: Example 5.1. The branching tree
Other Lower Bounds for TSP
The lower bound described above is constructed using analytical approach. Other lower bounds
can be obtained by solving dierent relaxations of TSP.
Recall the mathematical programming formulation of the problem, given in Chapter 1:
n
n
ÿ
ÿ
i“1
ÿ
ÿ
i“1
ÿ
j“1
ÿ
j“1
n
xij“ 1, j “ 1, . . . , n,
n
xij“ 1, i “ 1, . . . , n,
cijxijÑ min
xijPt0,1u
,
xijě 1, S Ă N, 1 ď |S| ď n ´ 1.
Here, the last set of constraint describes the connectivity requirement. Omitting it, we trans-
form TSP into the Assignment problem, which is polynomially solvable. In the next chapter,
iPS
jRS

62
Implicit Enumeration Methods
we consider this problem more thoroughly and give an
Opn4q
-algorithm solving it. Obviously,
the solution of the Assignment problem, though it might be infeasible for TSP, may serve as a
lower bound for it, and can de used in a B&B algorithm.
Lower bounds can also be produced by relaxing combinatorial formulations of the problem.
Consider the
cij“ cjifor each pair
symmetric
i, j(i ‰ i
version of TSP, i.e., the problem with symmetric distance matrix:
). Equivalently, it can be stated as the problem of nding in
a given complete weighted graph a minimum-weight connected spanning subgraph of degree
2 includingnedges. Relaxing the degree constraint, we expand the feasible set by adding
non-trivial
Denition 5.3.
spanning subgraph ofGthat consists of a spanning tree
incident to nodei:
In a weighted graph, a 1-tree
for
Gztiu
1-trees
, and
to cycles.
Given an undirected graph
Qi“ TiY tpi, pq, pi, qqu
Qiis called
pi, pq,pi, qq
are the shortest two edges incident toi.
G “ pV, Eq
.
minimal
. A
1-tree for node
Tifor
, if
Tiis a minimum-weight spanning tree
Gztiu
combined with two edges
i P V,Qi, is a
Obviously, a cycle is a 1-tree for all its nodes. Also, it is easy to see that the weight of a
minimal 1-tree
cycleC. Indeed, from denition of
Qi(for any
i P V q
does not exceed the weight of a minimum-weight hamiltonian
Qifollows that
fpC q “ fpCztiuq ` cik` cilě f pTiq ` cip` ciq“ f pQiq.
Therefore, the weight of any minimal 1-tree, as well as the maximum of their weights, is a lower
bound for the symmetric TSP.
Minimum-weight spanning trees for this bound can be eectively constructed using, for
example, the Prim's algorithm.
Algorithm 5.2
Input:
a weighted undirected graph
Initialize:
The Prim's Algorithm for the Minimum-Weight Spanning Tree Problem
set the tree
T “ pt1u, Hq
G “ pV, Eq
.
.
repeat
Find the edge
add the edge to the tree:
until
all the nodes are connected toT.
Example 5.2.
pp, qq:cpq“ min
iPT,jRT
T :“ T Y pp, qq
cij,
,
Solve the following instance of symmetric TSP using 1-tree lower bound.
1 2 3 4 5
1 - 48 27 31 43
2 48 - 28 44 43
3 27 28 - 40 36
4 31 44 40 - 46
5 43 43 36 46 -
The subset representation, branching scheme and upper bound are the same as before. Calculate
the lower bound for the initial set
xt1u, tuy
. In the gure below, the minimal 1-trees for all the
graph's nodes are represented. The one with the maximum weight of 172 is the 1-tree for node

Balas Additive Algorithm
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
2
b
1
b
3
b
4
b
5
b
63
3 (in the center). The candidate cycle provided by the greedy algorithm is
its length
f0“ 175
. Branch to
xt1, 3u, tuy
and
xt1u, t3uy
. As for the rst subset, the lower
x0“ p1, 3, 2, 5, 4, 1q
bound does not change, since all the minimal 1-trees above include edge (1,3). Consider the
second subset. Change
c13to
8
and construct minimal 1-trees for the new set of distances
(below). The maximum weight equals 181 (for node 3), which is greater than the upper bound,
and the subset is discarded. Branch from
for the rst set the lower bound remains 172. For the second one, we set
xt1, 3u, tuytoxt1, 3, 2u, tuy
and
xt1, 3u, t2uy
c13“ c23“ 8
. Again,
and
construct 1-trees. Note 1-tree for nodes 2 and 5: it is a cycle, and, obviously, it is the optimal
,
element of the subset. Its weight is 181, so we prune the enumeration tree at this node.
Remaining subset
x0“ p1, 3, 2, 5, 4, 1q
xt1, 3, 2u, tuy
, and
p1, 3, 2, 4, 5, 1q
consists of two cycles: the one we have already considered,
of length 188. Therefore,
x0is the optimal solution.
The resulting branching tree is given in g.5.2. The pruned nodes are depicted gray.
5.2. Balas Additive Algorithm
In this section, we consider another implicit enumeration method developed by Egon Balas to
solve 01 linear programs:
n
ÿ
zpxq “
where
aij, bi, cjP R,i “
in non-decreasing order:
1
x
“ 1 ´ xj).
j
1, m,j “ 1, n
0 ď c1ď c2ď ¨ ¨ ¨ ď cn(if
Inspiration for the method comes from the observations below:
cjxjÑ min
j“1
n
ÿ
xPB
,
n
aijxjě bi, i “ 1, . . . , m,
j“1
. Also, we assume, values
cjă 0
for somej, we change variable
(5.5)
(5.6)
ciare nonnegative and arranged
xjto

64
f = 188
(1,3,2,5,4,1)
f = 175
{1,3}{2}
LB = 181
{1,3,2}{}
LB = 172
{1}{3}{1,3}{}
LB = 172 LB = 181
{1}{}
LB = 172
x0= (1, 3, 2, 5, 4, 1)
f0= 175
(1,3,2,4,5,1)
Implicit Enumeration Methods
Figure 5.2: Example 5.2. The branching tree
•
since all the coecients of the objective function are nonnegative, we would prefer to set
all the variables to zero to give the smallest value toz;
•
if we cannot set all the variables to zero without violating some of the constraints, then
we prefer to set the variable with the smallest index to 1;
•ifx
is a feasible solution, then changing any of its zeros to 1 increases the objective
function (whether or not the solution remains feasible).
That is, we can solve the linear program (5.5)(5.6) using the following procedure. Start with
setting all the variables equal to zero (assuming all of them are free, i.e., can be changed later)
and then branch from one solution to another assigning 1 to one of the free variables or xing
its zero value. The branching continues until one of the following conditions is satised:
1. a feasible solution is reached: in this case, all the descendants have greater (or equal)
values and are of no interest;
2. the solution's value is greater or equal to that of some feasible solution: again, all the
descendants have even greater values;
3. the solution is assured to have no feasible descendants.
At this point, the branch is pruned and we go to another one. The process stops, when all
the branches are pruned. The best of the feasible vectors found during the procedure is the
solution of the problem. If we don't nd a feasible vector during the process (all the branches
have been pruned as leading to infeasible solutions), the feasible set is empty.

Balas Additive Algorithm
To give a more precise formulation, we need to introduce some notations. Letxbe a boolean
vector, denote
sipxq “
n
ÿ
aijxj´ bi, i “ 1, . . . , m.
j“1
65
That is, vectorxsatises the problem's constraints (5.6) if and only if
Consider a nodetof the enumeration tree and denote by
t
variables. Also,
of indices of free variables is denoted as¯Nt:
representative
) is associated with each nodet:
N
t
, N
Ď Ntare indices of variables xed as 1 and 0, respectively. The set
1
0
NtY¯Nt“ t1, 2, . . . , nu
"
“
1, j P N
0, j P N
t
x
j
t
,
1
t
Y¯Nt.
0
Ntthe set of indices of xed
sipxq ě 0
for eachi.
. A boolean vector
xt(a
ř
The vector has value
constraints:
sipxtq ă 0
zpxtq “
for somei.
cjand may be infeasible with respect to some of the problem's
t
jPN
1
Pruning rules
As mentioned above, a branch is pruned at some nodetwhen one of three sequentially checked
conditions is satised.
Pruning by value
zpxtq
, or to a lower bound
Pruning by feasibility
update the solution (as the node hasn't been pruned by value):
. We have a feasible solutionˆx, the value
z
on
zpxtq
.
. Vector
xtis feasible:
sipxtq ě 0
ˆz “ zpˆxq
of which is less or equal to
for alli. In this case, we also should
ˆx “ xt,
ˆz “ zpxtq
.
Pruning by infeasibility
. The node doesn't have feasible descendants. One of many ways to
check this condition without solving a boolean inequality system is as follows. We choose a
violated constrainti(which exists, since the node hasn't been pruned by feasibility) and check
if it can be possibly satised by setting to 1 all the free variables that correspond to positive
aij. That is, we calculate
for each
ÿ
hiptq “ sipxtq `
i
sipxtq ă 0
. If
hiptq ă 0
`
a
“ sipxtq `
ij
t
jP¯N
for somei, then, obviously, corresponding constraint
ÿ
maxt0, aiju
t
jP¯N
cannot be satised for any descendant of nodet.
Branching strategy
Lettbe a node that cannot be pruned. When choosing a free variable to branch, one should
keep in mind the following guidelines.
Move towards minimum
. That is, all other factors are equal, it is preferable to branch along the
variable with the smallest index (assigning it to 1 adds minimal value to the objective function).

66
Implicit Enumeration Methods
Move toward feasibility
. It is reasonable to choose the variable, which makes the solution more
feasible when set to 1. A number of heuristic rules are proposed to determine the most
promising variable. One of them is as follows. Calculate values
m
ÿ
vjptq “
each of which is the sum of right sides of all violated constraints when
Apparently, if
values
vjare negative, then assigning 1 to the variable with maximal
vj“ 0
for somej, then setting
mint0, sipxtq ` aiju, j P¯Nt,
i“1
xjis assigned to 1.
xjequal 1 gives us a feasible solution. If all the
vjis likely a step towards
a feasible vector.
Another observation worth making: if
s
pxtq ă 0
i
l
factors:
a
il,j
for all
ď 0
l “ 1, . . . , k
for all
l “ 1, . . . , k
, and a free variable
xtis infeasible with respect to constraints
xjoccurs in each of
s
pxq
i
l
i1, i2, . . . , ik:
with non-positive
, it may not be considered as a branching candidate, since
xing it as 1 increases infeasibility.
Search for uniquely specied variables
enumeration. For example, if
thei-th condition is to set
aijă 0
. Also, if
sipxtq ă 0
sipxtq ă 0
xj“ 1
and there is a single free variable
. Sometimes, values of free variables can be xed without
and
hiptq “ 0
for
j P¯Ntsuch that
for somei, then the only way to satisfy
aiją 0
, and
xj“ 0
xjsuch that
for
j P¯Ntsuch that
aiją 0
, then this
variable can be set to equal 1.
Branching process
When a branching variable
t
. In node
diers from
For node
representative and values
0
t
x
“ xtis still infeasible, so its feasible descendants (if there are any) must have at least one
t1,
xlis xed as 1:
xtby 1 inj-th position,
t0,
xj“ 0:N
xl,
l P¯Nt, is chosen, we attach two descendants,
N
0
t
“ Nt,
1
si(
i “ 1, . . . , m
1
t
“ NtY tlu,N
1
1
t
zpx
q “ zpxtq ` cl.
0
t
N
0
) and
“ N
1
t
0
t
Y tlu
0
vj(
j P¯Ntztlu
“ N
1
t
t
,¯N
0
0
t
,¯N
“¯Ntztlu
) from its predecessor. Note that
“¯Ntztlu
t1and
t0, to node
. Representative
. This node inherits
free variable assigned to 1. Therefore, the value of these descendants is at least
ÿ
0
t
zpx
q “
jPN
0
t
cjxj` min
jP¯N
cj“ zpxtq ` min
0
t
jP¯Ntztlu
cj.
This lower bound can be used for pruning.
Example 5.3.
Solve the following linear program:
zpxq “ x1` 3x2` 5x3` 7x4` 10x5Ñ min
xPB
,
3
s1pxq “ ´4x1` x2` x3´ 3x4` 5x5´ 2ě 0,
s2pxq “ 2x1´ 2x2´ 2x3` 6x4´ 3x
s3pxq “ ´ x
2
´ x4` 2x5´ 1ě 0.
ě 0,
5
x
(5.7)
(5.8)
(5.9)
(5.10)
1
t
For brevity, we denote solutions by sequences
t˚, 1, 0un, where 0s and 1s occupy positions of
xed variables, and *s are placed for free variables. For example,
two xed variables:
x3“ 1
and
x5“ 0
, and three free variables:
to be equal 0 before we branch.
p˚ ˚ 1 ˚ 0q
is for solution with
x1, x2, x4which are assumed

Balas Additive Algorithm
*****
z = 10
****1
****0
no feas. desc.
z = 0
x5= 1 x5= 0
s = (−2, 0, −1)
*****
***11
z = 10
****1
s = (3, −3, 1)
v1= −2, v4= 0
***01
****0
no feas. desc.
z = 17
feas. ˆx = (0, 0, 0, 1, 1)
z = 0
x5= 1 x5= 0
no feas. desc.
x4= 1 x4= 0
z = 11
s = (−2, 0, −1)
s = (3, −3, 1)
67
We start with initial solution
the third constraints:
s1“ ´2,s2“ 0,s3“ ´1
p˚ ˚ ˚ ˚ ˚q
, which have value
z “ 0
and violates the rst and
. Check if these constraints can be satised:
h1“ ´2 ` 1 ` 1 ` 5 ą 0, h3“ ´1 ` 2 ą 0,
that is, the solution, possibly, has feasible descendants. Now, check if some of the variables has
unique specications. Looking through the list of violated constraints we see that
x5is the only free variable that occurs in (5.10) with positive factor. Branch from
p˚ ˚ ˚ ˚ 1q
Now, consider node
s3“ 1
variable. Note that free variables
are unpromising at this point. Calculate
and
p˚ ˚ ˚ ˚ 0q
and prune the second node by infeasibility.
p˚˚˚ ˚1q
. Its value is 10 and it violates constraint (5.9):
. The constraint can, possibly, be satised, since
x2and
x3occur in (5.9) with negative factors and, therefore,
v1and
v4:
h2“ ´3 ` 6 ą 0
. Choose the branching
s3ă 0
and
p˚ ˚ ˚ ˚ ˚q
s1“ 3,s2“ ´3
to
,
v1“ p3 ` p´4qq ` pp´2q ` 1q ` 0 “ ´2, v4“ p3 ` p´3qq ` 0 ` p1 ` p´1qq “ 0.
That is, assigning
p˚ ˚ ˚01q
ˆz “ 17
. The rst node is pruned by feasibility:
. Consider
The solution is infeasible with respect to the second constraint. Calculate
x4to 1 will provide us with a feasible solution. Branch to
p˚ ˚ ˚01q
ˆx “ p0, 0, 0, 1, 1q
. The lower bound on values of its descendants is
is a feasible solution of value
h2:
p˚ ˚ ˚11q
and
z “ c5` c1“ 11
h2“ ´3 ` 2 ă 0
that is, the constraint cannot be satised, and the node doesn't have feasible descendants. All
the branches are pruned, the solution is
ˆx “ p0, 0, 0, 1, 1q,zpˆxq “ 17
.
.
,

68
5.3. Exercises
5.1.
Solve the following instance of TSP using Branch and Bound.
To city
1 2 3 4
1 - 27 44 28
2 47 - 43 36
3 29 26 - 29
4 34 35 34 -
From city
5.2.
Solve the following instance of TSP using Branch and Bound.
To city
1 2 3 4 5
1 - 32 37 37 29
2 40 - 40 28 31
3 41 34 - 34 37
4 36 37 33 - 27
From city
5 31 39 33 38 -
Implicit Enumeration Methods
5.3.
Solve the following instance of the Symmetric TSP using Branch and Bound with 1tree
lower bound.
To city
1 2 3 4 5
1 - 38 40 35 39
2 38 - 41 37 42
3 40 41 - 43 39
4 35 37 43 - 36
From city
5 39 42 39 36 -
5.4.
Solve the instance of the 01 Knapsack Problem from exercise 3.3 using Balas additive
algorithm.

Chapter 6.
b b
b
b
b b
b
b
b b
b
b
b b
b
b
b b
b
b
b
b
bb
Matchings and Assignments
In this chapter, we consider two linear optimization problems,
lem
and
the Assignment Problem
, which nd various and numerous application in scheduling,
the Maximum Matching Prob-
resource allocation and other branches of Operations research. Though these problems can be
solved using standard linear programming techniques, more eective methods were invented.
Below, we discuss a
dual
approach to solve the Assignment Problem [2].
combinatorial
algorithm for the Maximum Matching Problem and a
primal-
6.1. Matching and Vertex Cover
Given an undirected graph
Denition 6.1.Amatching
at most one edge of
A matching is
M
perfect
A matching is called
Obviously, a perfect matching, if it exists in a graph, is also maximal. In the gure below,
three matchings in a graph are depicted: (a) an imperfect matching of cardinality 3, which is
not maximal (though, no edge can be added to it without violating disjointedness condition);
(b) two perfect matchings of maximal cardinality 4.
G “ pV, Eq
M Ď E
.
is a disjoint set of edges such that for each
that is incident tov.
if each
maximal
v P V
is incident to exactly one edge ofM.
if there is no matching of greater cardinality.
v P V
there is
(a) A matching
(b) Two perfect matchings
Figure 6.1: Matchings in a graph
Denition 6.2.
A set of nodes
R Ď V
is called a
vertex cover
if each edge
e P E
is incident to
at least one node ofR.
A vertex cover is
minimal
if there is no vertex cover of smaller cardinality.

70
b b
b
b
b b
b
b
b b
b
b
b b
b
b
Matchings and Assignments
(a) A cover
(b) A minimal cover
Figure 6.2: Vertex covers in a graph
In the gure 6.2, two vertex covers in a graph are shown: (a) a vertex cover of cardinality
5, no node of which can de removed without leaving some edges uncovered; (b) a vertex cover
of cardinality 4, which is minimal for this graph.
There is a duality connection between matchings and vertex covers in a graph.
Remark
holds:
6.1.Let
|R| ě |M |
M
andRbe a matching and a vertex cover in
G “ pV, Eq
. The inequality
. Therefore, the cardinality of a minimal vertex cover is not less than that of
a maximal matching.
Indeed, let
least one of the nodes of each pair
Note that the problem of nding a minimal vertex cover in a graph is known to be
M “ tpi1, j1q, pi2, j2q, . . . , pik, jkqu
til, jlu,l “ 1, . . . , k
. In order toMbe covered,Rmust include at
. That is,
|R| ě |M |
.
N P
hard (see Chapter 2), though a maximum matching can be found in polynomial time. The
duality relation inequality is useful to conrm minimality of a given vertex cover: for example,
the vertex cover in g.6.2-b is minimal, since its cardinality is equal to the cardinality of the
matchings in g.6.1-b.
-
6.2. Maximum Matching Problem
In this section, we consider the
Maximum Matching Problem.
matching
MinG
.
One of the rst algorithms to solve the problem was proposed by Jack Edmonds in 1960ies.
The basic idea is quite straightforward: we start with some matching
edge) and iteratively improve it by switching some edges between
cardinality increases at each step. The process stops when no further improvement is possible.
The main question is, how to construct a matching larger than a given one. The answer comes
from the concept of
Denition 6.3.
augmenting paths
Given a matching
P “ tv0, e1, v1, e2. . . , ep, vpu,viP V,eiP E
1. odd edges of the path
2. even edges of the path
3.
v0is not incident to any edge inM.
e1, e3, . . .
e2, e4, . . .
Given an undirected graph
.
M
inG. An
alternating path
, such that:
belong to
EzM
;
belong toM;
G “ pV, Eq
M
. Find a maximal
M
(e.g., with a single
and
with respect to
EzM
so that the
M
is a path
Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]
