1. Initialization. The only way of arriving at cells in the
leftmost column is from below, and the only way of arriving at cells in
the lowest row is from the left. (B = cost of arriving from below, L =
cost of arriving from the left.)
|
B: 7 |
|
|
|
|
|
|
B: 7 |
|
|
|
|
|
|
B: 6 |
|
|
|
|
|
|
B: 2 |
|
|
|
|
|
|
B: 1 |
|
|
|
|
|
|
B: 1 |
|
|
|
|
|
|
|
L: 2 |
L: 6 |
L: 15 |
L: 19 |
L:1 |
|
|
|
|
|
|
2. Recursion. Now consider the task of filling in the portion
of the table above and to the right of (2,2). Cheapest arrival routes are
marked in red. The cost of arriving from below-left, BL, is the cost of
the cheapest route to the below-left cell plus half the distance in the
arrival cell. For example, the cost of arriving at (3,2) is the cheapest
cost to (2,1), 2, plus half the value of (3,2), ½.
|
B: 7 |
|
|
|
|
|
|
B: 7 |
|
|
|
|
|
|
B: 6 |
|
|
|
|
|
|
B: 2 |
|
|
|
|
|
|
B: 1 |
|
|
|
|
|
|
B: 1 |
B: 2 L: 1 BL: 1 |
B: 7 L: 2 BL: 2½ |
|
|
|
|
|
L: 2 |
L: 6 |
L: 15 |
L: 19 |
L:1 |
|
|
|
|
|
|