1.  Shortest path algorithms

There are several categories of weights:

In addition, there are 2 basic flavors of the algorithms

Here is a table of the algorithms which are used.

w(e) = 1
w(e) ³ 1
w(e) Î R
Single
BreadthFirstSearch
Dijkstra
Bellman-Ford
all
BFS
Dijkstra
Johnson

2.  Rings

A ring is defined by R = (S,Å,Ä,0,1) where S is a set, Ä,Å:S2® S are binary operations. 0 is the identity element of Å and 1 the identity element of Ä. Rings also obey the following rules:

A semiring must satisfy every requirement except for the last.

2.1  ring matrices

Given any ring a matrix ring, Rn×n = (Sn×n,Ån×n,Än×n,0n×n,1n×n) can be defined. 0n×n is the 0 matrix and 1n×n is the identity matrix. The addition operator is defined elementwise and the multiplication operator is defined as: An×nÄn×nBn×n = Åk = 1n(AikÄBkj) .

2.2  ring examples

2.3  Shortest path through rings

Consider the min,+ ring above. Construct an n×n ring from it. Assign the weights,

Aij =
wij
if
(vi,vj) Î E
0
if
i = j
¥
else

To compute all pairs shortest paths, calculate An-1 .

2.4  timing analyses

The simplest way to calculate this is by multiply A together n-1 times which has cost O(n4) . This can be cut to O(n3log(n)) by doing the multiplications in a more clever order.


File translated from TEX by TTH, version 1.30.