Up: 2 Branch & Bound
Previous: 2.1 Starting Branch &
Next: 3 The Great Deluge
2.2 The Branch & Bound Algorithm
Saying the algorithm doesn't check all valid solutions requieres an explanation of the algorithm.
We use a kind of treeprunning to cut off solution paths, that cannot lead to an better solution.
Branch and Bound keeps track of all analysed paths using a sorted history list. The shortest paths can be found at the beginning.
In each step of the algorithm the first path (shortest) is expanded. This means that all edges that lead further and are not cyclic, or if cyclic are a solution, are sorted into the history.
If the first path already is a solution the algorithm ends because we assume that the length of each edge is positive.
For the more mathematical inclined:
Let:
Knot
be the start of the round trip, where
is the set of all knots.
be a set of all edges leading away from
, where
is a set of all edges.
An edge is an triple
where
is the start knot,
the length,
the end knot.
be the actual processed path.
a sorted list of all visited paths, shortest path first.
A path is a list of edges
to
satisfying the following equations:
 |
|
|
(1) |
 |
|
|
(2) |
A path is cyclic if:
 |
(3) |
The length of a path is:
 |
(4) |
Our implementation is very straight forward:
- set start Knot
,
- first element
in
is a solution
best solution
 |
(5) |
else set
- expand
![$\displaystyle M = \{[P, e]\;\vert e \in E(s) \}$](img29.gif) |
(6) |
- check cycles
- check solution
- sort in
 |
(10) |
-
2.
Up: 2 Branch & Bound
Previous: 2.1 Starting Branch &
Next: 3 The Great Deluge