classical shortest paths.
- dijkstra's
algorithm
- floyd's
algorithm. similarity to matrix multiplication
Matrices
- length
2 paths by squaring
- matrix
multiplication. strassen.
- shortest
paths by ``funny multiplication.''
- huge
integer implementation
- base-(n + 1) integers
Boolean matrix multiplication
- easy.
- gives
objects at distance 2.
- gives nMM(n) algorithm for problem
- what
about recursive?
- well
can get to within 2: let Tk
be boolean ``distance less than or equal to 2k.
Squaring gives Tk + 1.
- O(log n) squares for unit length
- what
about exact?
Seidel's distance algorithm for unit lengths.
- log-size
integers:
- parities
suffice:
- square
G to get adjacency A',
distance D'
- if
Dij
even then Dij = 2D'ij
- if
Dij
odd then Dij = 2D'ij - 1
- For
neighbors i, k,
- Dij - 1
Dkj
Dij
+ 1
- exists
k, Dkj = Dij - 1
- Parities
- If Dij even,
then D'kj
D'ij
for every neighbor k
- If Dij odd,
then D'kj
D'ij
for every neighbor k, and strict for at
least one
- Add
- Dij even iff
Sij =
D'kj
Dijd (i)
- Dij odd iff
D'kj < Dijd (i)
- How
determine? find S = AD'
To find paths: Witness product.
- easy
case: unique witness
- multiply
column c by c.
- read
off witness identity
- reduction
to easy case:
- Suppose
r columns have witness
- Suppose
choose each with prob. p
- Prob.
exactly 1 witness: rp(1 - p)r - 1
1/e
- Try
all values of r
- Wait,
too many.
- Approx
- Suppose
p = 2/r
- Then
prob. exactly 1 is
2/e2
- So
anything in range 1/r...1/2r
will do.
- So
try p all powers of 2.
- suppose
2k
r
2k
+ 1
- choose
each column with probability 2-k.
- prob.
exactly one witness: r . 2-k(1
- 2-k)r - 1
(1/2)(1/e2)
- so
try log n distinct powers of 2, each O(log n) times
· Mod
3:
o Recall
some neighbor distance down by one
o so
compute distances mod 3.
o suppose
Dij = 1 mod 3
o then
look for k neighbor of i
such that Dkj = 0 mod 3
o let
Dij(s)
= 1 iff Dij = s mod 3
o than
AD(s) has ij = 1 iff a neighbor k of i has Dkj(s)
o so,
witness matrix mul!
· Min-cut
implementation
· data
structure for contractions
· alternative
view--permutations.
· deterministic
leaf algo
· recursion:
|
pk + 1
|
=
|
pk - pk2
|
|
|
qk
|
=
|
4/pk + 1
|
|
|
qk + 1
|
|
= qk + 1 + 1/qk
|
|
·
· cut
counting
· Reliability
· Sampling