Finding cycles using rectangular matrix multiplication and dynamic programming - PowerPoint PPT Presentation

PPT – Finding cycles using rectangular matrix multiplication and dynamic programming PowerPoint presentation | free to download - id: d2294-ZDc1Z

The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
Title:

Finding cycles using rectangular matrix multiplication and dynamic programming

Description:

Finding cycles using. rectangular matrix multiplication and dynamic programming ... Algorithms for finding triangles. Let A be the adjacency matrix of a graph G. ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 30
Provided by: UriZ
Category:
Tags:
Transcript and Presenter's Notes

Title: Finding cycles using rectangular matrix multiplication and dynamic programming

1
Finding cycles using rectangular matrix
multiplication and dynamic programming
• Raphael Yuster Haifa Univ. - Oranim
• Uri Zwick Tel Aviv University

2
Matrix multiplication

?
Authors Complexity
folklore n3
Strassen (1969) n2.81
??? n?
3
Rectangular Matrix multiplication
c
c
b

?
a
a
b
a
c
a

?
b
c
b
M(a,b,c) M(b,c,a) M(c,a,b) ...
4
Rectangular Matrix multiplication
c
b
c

a
?
a
There are also improved specially designed
rectangular matrix multiplication algorithms
5
Chain Matrix Product
• Let Ai be an ni? ni1 matrix.
• Compute A1A2Ak.
• Matrix multiplication is associative, so all
association orders give the same result, but may
have vastly different cost.
• Easy to solve using dynamic programming.

6
Chain Matrix Product (cont.)
• Let P(i,j) be the cost of computing AiAj.

Complexity of naïve solution is O(k3). For
M(a,b,c)abc, there is a much more complicated
O(k log k) algorithm.
7
Finding triangles
A triangle
A graph
Does the graph contain a triangle?
Yes!
8
Algorithms for finding trianglesLet A be the
adjacency matrix of a graph G. Then, G contains
a triangle iff A2?AT?0.
Authors Running time
folklore mn
folklore n? lt n2.38
Itai-Rodeh 78 m3/2
AYZ 97 m2? /(?1) lt m1.41
9
Finding triangles in O(m2? /(?1)) time AYZ 97
? m(?-1) /(?1)
Let ? be a parameter.
. High degree vertices vertices of degree
? ?.Low degree vertices vertices of degree lt ?.
There are at most 2m/? high degree vertices

10
Finding longer cycles
• A graph G contains a Ck iff Ak-1?AT?0 ?

We want simple cycles!
11
Color coding AYZ 95
Assign each vertex v a random number c(v) from
0,1,...,k-1. Remove all edges (u,v) for which
c(v)?c(u)1 (mod k). All cycles of length k in
the graph are now simple. If a graph contains a
Ck then with a probability of at least k - k it
still contains a Ck after this process. An
improved version works with probability 2 -
O(k). Can be derandomized at a logarithmic cost.
12
Finding C2k in O(m2-1/k) time AYZ 97
? m1/k
Let ? be a parameter.
. High degree vertices vertices of
degree ? ?.Low degree vertices vertices of
degree lt ?.
There are at most 2m/? high degree vertices

Finding paths of length k
Finding a cycle passing through a high degree
vertex
13
Algorithms for finding a Ck
Authors Running time
Monien 85 mn
AYZ 95 n? lt n2.38
AYZ 97 m2-1/?k/2?
AYZ 97We have not been able to use fast
matrix multiplication to obtain faster algorithms
for finding Ck, for k?4, in sparse graphs.
14
Finding even cycles even faster YZ 97
In undirected graphs, a C2k, for any fixed k, can
be found in O(n2) time!
We are still working onFinding odd cycles ???
???? ???
15
Algorithms for finding a C4
Authors Running time
Monien 85 mn
AYZ 95 n? lt n2.38
AYZ 97 m3/2
Eisenbrand, Grandoni 03 m 2-2/? n1/?
YZ 03 m(4?-1)/(2?1)ltm1.48
16
Finding C4s in O(m 2-2/? n1/?) time
Eisendbrand, Grandoni 03
Let ? be a parameter.
. High degree vertices vertices of
degree ? ?.Low degree vertices vertices of
degree lt ?.
There are at most 2m/? high degree vertices
17
Finding C4s in O(m 2-2/? n1/?) time EG 03
18
Finding C4s in O(m(4?-1)/(2?1)) time YZ 03
Let ? be a parameter. High degree vertices
? deg(v) Medium degree vertices ?1/2
deg(v) lt ? Low degree vertices
deg(v) lt ?1/2
There are at most 2m/? high degree
vertices.There are at most 2m/?1/2 medium degree
vertices.
19
Finding C4s in O(m(4?-1)/(2?1)) time YZ 03
20
• Where do we go from here?
• Why just three degree classes?
• How many cases will we have for C5, C6, ?

21
The general case
• Partition the vertices into log n degree classes
Vi v?V 2i deg(v) 2i1
• Number of cycle classes is only (log n)k.
• What is the most efficient way of handling each
class?

22
Handling a given cycle class
Choose i and j. Find all paths of length j-i that
pass through vertices of degrees di ,, dj. Find
all paths of length k-(j-i) that pass through
vertices of degrees dj ,, di. Check whether the
graph contains a cycle from the class.
23
Finding paths
Degree
Sizeof class
We get a chain matrix product problem! We can use
the sparsity of the matrices.
24
Finding paths (cont.)
It is convenient to express everything as a power
of m.
Degree
Sizeof class
25
Finding cycles
Theorem There is an time
algorithm for finding Cks
in directed graphs.
26
Finding C5s
Theorem
Requires a non-constant number of degree
classes. The worst-case running time is obtained
for regular graphs.
27
Finding C6s
Conjecture
If the conjecture is true, then c6lt1.65.
28
Finding odd cycles
Conjecture
for odd k?3.
The conjecture holds for k3,5.
29
Open problems
• Is it possible to extend the technique presented
to obtain improved algorithms?
• Find a feasible way for rigorously computing c6,
c7, etc.
• Other applications?