Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Fundamentals of Operations Research. A textbook

.pdf
Скачиваний:
0
Добавлен:
06.09.2026
Размер:
2 Мб
Скачать
Exercises
1
3
4
8
5
9
6
2
7
51
The algorithm converges in three steps. The critical time of the project is
Te“ T
e
163
9
the latest nish times using algorithm 4.4.
i
Step 0 Step 1 Step 2 Step 3
e
T
1 163 20 0 0 0 2 163 24 24 24 4 3 163 24 24 24 24 4 163 57 57 57 52 5 163 99 99 99 99 6 163 86 86 86 81 7 163 119 119 119 114 8 163 94 94 94 30 9 163 163 163 163 163
Comparing the latest times with the earliest times, we nd critical events: the full oats using the relation
j
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
arc
13 14 47 79 28 45 59 89 29 35 34 67 26 24 23 16 46 12
Πj0 5 55 5 64 35 0 64 142 0 30 5 32 48 20 42 5 20
Tasks of arcs
t1, 7, 10u
have zero full oats and, therefore, are critical. Finally, the critical path consists
tp1, 3q, p3, 5q, p5, 9qu
Πj“ T
and has length 163.
l
kpjq
´ T
e
ipjq
´ τj.
t1, 3, 5, 9u
. Calculate
. Find
4.3. Exercises
4.1.
Construct a network for the project given below by a list of tasks with their predecessors.
task 1 2 3 4 5 6 7 8 9 10
predecessors
Simplify the network (if it is possible) and calculate the ranks of events.
4.2.
Simplify the project network in the gure 4.9.
H H H
1 1,2 2,3 3 4,5 6,7 7
Figure 4.9: A network
4.3.
Calculate node ranks for the network from example 4.4.
4.4.
Consider a project network with following parameters.
52
j
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
arc
49 47 67 68 24 23 16 13 37 12 15 56 14 19 35 27 34 89
τ
1 52 6 13 65 52 47 20 34 30 33 64 47 60 30 66 36 44
j
Project Management
Find the network's sources and sinks, the earliest and latest times of the nodes, the critical time of the project, the total oats, critical jobs and paths.
Chapter 5. Implicit Enumeration Methods
In this chapter, we discuss the general
where feasible setDis a nite subset of there is a nite number of feasible solutions, one may intend to simply enumerate all of them and choose the best one. In practice, though, this approach is rarely successful: as a rule, the number of choices grows explosively with problem size, and total enumeration becomes completely unworkable very quickly.
To deal with discrete problems that cannot be solved eciently in other ways (rst of all,
with
N P
-hard problem), dierent on the observation that systematic enumeration of a nite solution set usually has a tree-like structure and can be represented by so-called
For example, if we solve an instance of boolean linear programming problem:
$ &
%
a natural way to enumerate the solutions is to x the rst variable as1or0(that is, to split the feasible set into two subsets containing solutions with then enumerate the values of and, nally, enumerate the values of enumeration tree (the tree is shown below). Note that only six of them are feasible.
When performing exhaustive, or the leaves of the enumeration tree. Implicit enumeration approach suggests operating with nodes of higher levels and eliminating some of them as unpromising without considering all of their numerous descendants individually.
In this chapter, we outline two major implicit enumeration techniques:
Bound Method Additive Algorithm
, which is widely used in the eld of combinatorial optimization, and
for the boolean linear programming.
x2for both of the subsets (that gives us 4 subsets of smaller size),
discrete
fpxq Ñ min
Implicit Enumeration
4x1´ 4x2` 3x3Ñ min, 3x1´ 2x2` 5x3ě 2,
x1, x2, x3P t0, 1u,
x3, that leads us to 8 one-element subsets, leaves of the
explicit
optimization problem:
,
xPD
n
R
(or any other set of limited cardinality). Since
methods are used. These methods rely
enumeration tree
, enumeration, we search for the best solution among
.
x1“ 1
and
x1“ 0
, respectively),
the Branch and
(5.1)
Balas
5.1. Branch and Bound
The essence of the Branch and Bound (B&B) technique is the following observation: if at some node of enumeration tree we manage to ensure that corresponding subset does not include
54
D
1 ∗ ∗ 0 ∗ ∗
11 10
011
00
111 110 101 100
01
010 001 000
Implicit Enumeration Methods
optimal solution, then there is no need to consider its descendants. The tree can be
pruned
at this node. As a result we may, if fortunate, signicantly curtail the enumeration by excluding a number of non-empty subsets of solutions without considering each solution individually. Of course, in the worst case no subset can be discarded, and we perform exhaustive enumeration.
To decide whether a subset is promising or not, we calculate a
of this set, and compare it with an
upper bound
on the optimum (usually, it is a value of a
lower bound
on elements
reasonably good feasible solution). If it occurs that the lower bound is greater that or equal to the upper bound, the set does not contain solutions better than the one we already got, so, it can be pruned.
Now, we give the formal description of the method.
Denition 5.1.
Branching
is a set function that associates to a given subset
X Ď D
its
partition into a collection of nonempty proper subsets:
k
ď
Xi“ X, XiĂ X, Xi‰ H @i.
i1
for problem (5.1), if
b : 22
Denition 5.2.
1.
LBpX q ď min
D
2
, bpXq “ tX1, X2, . . . , Xku :
We call a function
fpxq
xPX
for each
LB : 2Ralower bound
X Ď D
, and
2.
LBptxuq “ f pxq,x P D
A B&B algorithm consists of a series of iterative steps: at each step an unpruned subset is considered, the lower bound is computed for this set, and then we either discarded the set or branch from it. The process continues until all the branches are pruned.
Theorem 5.1.
Proof.
The niteness of the algorithm follows from the fact that the feasible set is nite (and
Algorithm 5.1 solves minimization problem (5.1) in nite number of steps.
has, therefore, a limited number of subsets), and the observations that no subset is considered more than once.
Suppose the algorithm stops with
.
fpx0q ą min
x0, which is not optimal:
fpxq “ f px˚q.
xPD
Branch and Bound
55
Algorithm 5.1
Initialize:
The Branch and Bound Framework
set the collection
N “ tDu
, the candidate solution
x0“
null,fpx0q “ 8
.
repeat
choose a subset
if
X “ txu
set
x0“ x
else
calculate
(occasionally) choose
if
LBpX q ě fpx0q
else
branching fromX:
until Output:
N “ H
x0is the solution.
That means, the setXcontaining
.
X P N
then
, if
fpxq ă f px0q
LBpX q
,
,
then
, and discardXwithout branching:
x P X
and set
x0“ x
, if
fpxq ă f px0q
discardXwithout branching:
N :“ pNzXq Y bpX q
;
N :NzX
N :NzX
,
;
,
was removed at some step of the algorithm. That could
not be a one-element set: in this case the candidate solution must have been updated to Thus, the set was discarded when comparing lower and upper bounds:
fpx1q ă LBpxq ď min
fpxq “ f px˚q
xPX
.
for some
x1P D
, and
is not the optimum.
To implement the B&B approach to a particular optimization problem one must specify a series of parameters, which aect signicantly on how successful the implementation is. Among them are:
a subset representation,
a branching rule,
a lower bound,
which must be, at the same time, easily computable (since it is calculated at each node of enumeration tree) and accurate (the looser the bound, the less pruning it allows to perform). These are two seemingly incompatible conditions: for
N P
-hard problems, accuracy improvement is very often results in increase in time complexity, and vise versa. The usual way to obtain a lower bound is to omit some of the problem's constraints and nd the exact solution of the resulting
relaxed
problem. Also, an analytic
approach can be used;
selection of candidate solutions and an upper bound,
which, usually, is the value of the candidate solution (though analytical estimates can be involved, too). Candidate solu- tions are also desirable to be easily computable and be close to the optimal ones. Unlike calculating the lower bound, candidate solutions (and the upper bound) are not neces- sarily updated at each node. In practice, they are often provided by some heuristics, or approximate algorithms for the original problem. Another way is through solving the problem exactly for small-sized subsets.
In the following section, we illustrate the implementation of B&B methodology on the Traveling Salesman Problem.
56
Implicit Enumeration Methods
5.1.1. Branch and Bound for the Traveling Salesman Problem
Recall the problem. A salesman should visit a given set of citiesN, each exactly once, and nish his tour in the city he starts from. For each pair is known. Find the shortest tour. As we saw in Chapter 2, the problem is strongly
i, k P N,i k
, the distance
N P
cijě 0
-hard
and, therefore, it is unlikely to be solvable eciently. Solve it using B&B technique.
Set Representation
We divide the feasible set into subsets sub-path
J “ tj1, . . . , jqu
That is,
i1to
from for circuits that contain
I “ ti1, i2, . . . , ipu
and not containing arcs from
.
xI, J y
i2, then from
consists of all the routes passing through which the salesman goes rst from
i2to
i3,
. . .
, from
j1, j2, . . . , jq. Thus the pair
p1, 2q
and not contain
xt1u, tuy
i
p´1
xI, J y
, each of which combine circuits sharing a xed
ipto a given set of prohibited nodes
to
ip, and when leaving
iphe goes to the city distinct
describes the whole feasible setD,
p2, 3q
and
p3, 4q
, and so on.
Branching Scheme
When branching, we split a set the salesman goes to a given citykafter leaving the last city
xI, J y
into two subsets. The rst one consists of tours in which
ipof the partial routeI. The
second subset includes the tours in which such passage is prohibited.
More formally, given a subset
Jq| ą 2
and and
then we choose an arbitrary
xti1, . . . , ipu, tj1, . . . , jq, kuy xti1, . . . , ip, lu, tuy
.
xI, J y
, where
k P N zpI Y J q
. If
NzpI YJq “ tk, lu
I “ ti1, . . . , ipu
and
and branch from
then the set is split into
J “ tj1, . . . , jqu
Upper Bound
xt1, 2ut3, 4uy
. If
|NzpI Y
is
xI, J ytoxti1, . . . , ip, ku, tuy
xti1, . . . , ip, ku, tuy
To nd candidate solutions and calculate the upper bound we use a greedy heuristic
the nearest unvisited city¿
: the salesman begins his route at an arbitrary city and then, at each
¾go to
step, passes to the city, which hasn't been visited yet, and the distance to which is minimal among all the unvisited cities. When all the cities are visited, the salesman returns to his starting point. Time complexity of the algorithm is
Opn2q
.
Lower Bound
To calculate the lower bound on lengths of tours from Transform the distance matrix
||cik||
into
||c
1
||
:
ik
xI, J y
we use the following method.
$
8, i P ti1, i2, . . . , i
’ ’ &
1
c
ik
’ ’ %
i P N, k P ti2, i3, . . . , ipu, i ip, j P J Y ti1u,
cik,
otherwise.
u, k P N,
p´1
or
or
Branch and Bound
Dene the values
57
The lower bound is:
Lemma 5.1.
Proof.
Let
circuit from
Function
I “ ti1, . . . , ipu
xI, J y
. IfCis the only element of the set, then branching scheme), Therefore,
LBpI , Jq “
where
fpC q
is the length of the circuit.
Now, assume
|xI, J y| ą 1
andk. That implies
αi“ min
kRti2,i3,...,ipu
βk“ min
iRti1,i2,...,i
LBpI , Jq “
LBpI , Jq
be a partial tour and
p n
, and the onlyαandβvalues in (5.4) are
. From denition ofαandβfollows that
1
c
, i R ti1, i2, . . . , i
ik
1
tc
´ αiu, k R ti2, i3, . . . , ipu.
ik
u
p´1
p´1
ÿ
l1
c
ili
l`1
`
iRti1,...,i
ÿ
p´1
αi`
u
dened by (5.4) is a lower bound for
C “ ti1, . . . , ip, i
n´1
ÿ
l1
c
ili
l`1
` α
` β
i
n
n´1
ÿ
l1
c
ili
l`1
i
1
p´1
ÿ
kRti2,...,ipu
, . . . , in, i1u
p`1
J “ H
` c
ini
1
u;
βk.
xI, J y
.
be a hamiltonian
(see the description of
α
c
i
n
ini
1
and
β
f pCq,
1
c
ě αi` βkfor each
ik
i
1
(5.2)
(5.3)
(5.4)
0
.
i
Therefore,
n
ÿ
fpC q “
l1
c
ili
Example 5.1.
ÿ
lp
l`1
n
c
ili
l`1
p´1
ÿ
l1
n
ÿ
c
1
c
ili
l`1
lp
n
ÿ
`
ili
l`1
lp
ě
1
c
ili
n
ÿ
lp
iRti1,...,i
ě
l`1
pc
ÿ
1
ili
p´1
ÿ
l1
l`1
p´1
c
ili
´ α
αi`
u
Solve the following instance of TSP.
To city
1 2 3 4 5 1 - 48 27 31 43 2 33 - 28 44 43 3 41 28 - 40 36 4 37 35 29 - 46
From city
5 48 48 25 29 -
l`1
´ β
i
l
kRti2,...,ipu
`
iRti1,...,i
i
ÿ
ÿ
l`1
q `
p´1
βk.
u
n
ÿ
lp
αi`
α
`
i
l
ÿ
kRti2,...,ipu
n
ÿ
β
i
l`1
lp
βk“ LBpI , Jq.
Suppose, the salesman starts from the rst city, so, the initial set is
xt1u, tuy
.
58
Implicit Enumeration Methods
k1,5
k1,5
k1,5
k1,5
k1,5
i1,5
i1,5
i1,5
i1,5
i1,5
1
c
mint48, 27, 31, 43u “ 27,
1k
1
c
mint33, 28, 44, 43u “ 28,
2k
1
c
mint41, 28, 40, 36u “ 28,
3k
1
c
mint37, 35, 29, 46u “ 29,
4k
1
c
mint48, 48, 25, 29u “ 25.
5k
1
tc
´ αiu “ mint33 ´ 28, 41 ´ 28, 37 ´ 29, 48 ´ 25u “ mint5, 13, 8, 23u “ 5,
i1
1
tc
´ αiu “ mint48 ´ 27, 28 ´ 28, 35 ´ 29, 48 ´ 25u “ mint21, 0, 6, 23u “ 0,
i2
1
tc
´ αiu “ mint27 ´ 27, 28 ´ 28, 29 ´ 29, 25 ´ 25u “ mint0, 0, 0, 0u “ 0,
i3
1
tc
´ αiu “ mint31 ´ 27, 44 ´ 28, 40 ´ 28, 29 ´ 25u “ mint4, 16, 12, 4u “ 4,
i4
1
tc
´ αiu “ mint43 ´ 27, 43 ´ 28, 36 ´ 28, 46 ´ 29u “ mint16, 15, 8, 17u “ 8.
i5
α1“ min
α2“ min
α3“ min
α4“ min
α5“ min
β1“ min
β2“ min
β3“ min
β4“ min
β5“ min
It is convenient to storeαandβvalues in additional column and row of matrix
||c
1
||
:
ij
1 2 3 4 5
α
1 - 48 27 31 43 27 2 33 - 28 44 43 28 3 41 28 - 40 36 28 4 37 35 29 - 46 29 5 48 48 25 29 - 25
β
5 0 0 4 8
The lower bound for the set is calculated using (5.4):
LBpt1u, tuq “
5
ÿ
i1
αi`
5
ÿ
βk“ 154.
k1
The initial candidate solution that greedy algorithm gives us is is
f0“ 164
new nodes,
Consider
. Since
LB ă f0, the set
xt1, 2u, tuy
xt1, 2u, tuy
and
xt1u, t2uy
. Values
xt1u, tuy
.
1
1
c
,
c
, and
i2
1k
1
c
21
1 2 3 4 5
cannot be pruned. We branch and create two
are equal to8, so we have:
α
1 - 48 27 31 43 - 2 33 - 28 44 43 28 3 41 28 - 40 36 36 4 37 35 29 - 46 29 5 48 48 25 29 - 25
β
5 - 0 4 0
x0“ p1, 3, 2, 5, 4, 1q
. Its length
Branch and Bound
{1} {2}
LB = 154
{1,2} {}
LB = 175
{1} {}
LB = 154
x0= (1, 3, 2, 5, 4, 1) f0= 164
59
5
ÿ
αi` β1`
i2
1
c
. The lower bound is:
ij
5
ÿ
βk“ 175.
k3
, The grayed cells correspond to innite values of
LBpt1, 2u, tuq “ c12`
The lower bound exceed the known upper bound, so the node is pruned as unpromising.
For
xt1u, t2uy
, element
1
c
“ 8
12
. Matrix
1 2 3 4 5
1
||c
||
and vectorsαandβare given below.
ik
α
1 - 48 27 31 43 27 2 33 - 28 44 43 28 3 41 28 - 40 36 28 4 37 35 29 - 46 29 5 48 48 25 29 - 25
β
5 0 0 4 8
The lower bound is the same as in the initial node,
LB 154
. Current branching tree is given
in the gure below. The pruned node is depicted gray.
Set
xt1u, t2uy
For
xt1u, t2, 3uy
cannot be pruned and must be split, e.g., into
, values
1
c
ik
,
αi, and
βkare:
1 2 3 4 5
xt1, 3u, tuy
α
1 - 48 27 31 43 31 2 33 - 28 44 43 28 3 41 28 - 40 36 28 4 37 35 29 - 46 29 5 48 48 25 29 - 25
β
5 0 0 0 8
The lower bound is still 154. The greedy algorithm gives us tour so the upper bound does not change.
For
xt1, 3u, tuy
:
1 2 3 4 5
α
1 - 48 27 31 43 - 2 33 - 28 44 43 33 3 41 28 - 40 36 28 4 37 35 29 - 46 35 5 48 48 25 29 - 29
β
0 0 - 0 8
and
xt1u, t2, 3uy
p1, 4, 3, 2, 5, 1q
.
of length 179,
60
{1} {2,3}
LB = 154
{1,3} {}
LB = 154
{1} {2}
LB = 154
{1,2} {}
LB = 175
{1} {}
LB = 154
x0= (1, 3, 2, 5, 4, 1) f0= 164
The lower bound is:
LBpt1, 3u, tuq “ c13`
The current branching tree is given below.
Implicit Enumeration Methods
5
ÿ
αi` β1` β2` β4` β5“ 154.
i2
Now, we consider subsets
xt1, 3, 2u, tuy
1 2 3 4 5
and
xt1, 3u, t2uy
. For the rst one, we have:
α
1 - 48 27 31 43 - 2 33 - 28 44 43 43 3 41 28 - 40 36 - 4 37 35 29 - 46 37 5 48 48 25 29 - 29
β
0 - - 0 0
The lower bound is 164, which is equal to the value of current upper bound. The set is pruned. Note that the calculation of lower bound for this set can be omitted, for it contains only 2 tours, which can be easily enumerated.
For
xt1, 3u, t2uy
:
1 2 3 4 5
α
1 - 48 27 31 43 - 2 33 - 28 44 43 33 3 41 28 - 40 36 36 4 37 35 29 - 46 35 5 48 48 25 29 - 29
β
0 0 - 0 0
and the lower bound is 160. Applying greedy algorithm, we get the tour length
f1“ 160 ă f0, so, the upper bound is updated at this point. Moreover, the new upper
x1“ p1, 3, 5, 4, 2, 1q
of
bound equals the lower bound for the set, therefore, the set is pruned.
Then, branching from
The branching tree is shown below.
xt1u, t2, 3uy
, we ensure that tour
x1is the solution of the problem.