The lowest-cost accumulated distance matrix


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.)
 
7
0
B: 7
0
1
4
1
1
6
1
B: 7
1
0
1
0
4
5
4
B: 6
4
1
0
1
9
4
1
B: 2
1
0
1
0
4
3
0
B: 1
0
1
4
1
1
2
0
B: 1
0
1
4
1
1
1
1
1
L: 2
4
L: 6
9
L: 15
4
L: 19
0
L:1
 
1
2
3
4
5
6

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), ½.
 
7
0
B: 7
0
1
4
1
1
6
1
B: 7
1
0
1
0
4
5
4
B: 6
4
1
0
1
9
4
1
B: 2
1
0
1
0
4
3
0
B: 1
0
1
4
1
1
2
0
B: 1
0
B: 2
L: 1
BL: 1
1
B: 7
L: 2
BL: 2½
4
1
1
1
1
1
L: 2
4
L: 6
9
L: 15
4
L: 19
0
L:1
 
1
2
3
4
5
6

Next: the finished matrix