Raphael Yuster Haifa University Uri Zwick Tel Aviv University

Slides:



Advertisements
Similar presentations
all-pairs shortest paths in undirected graphs
Advertisements

1 Efficient algorithms on sets of permutations, dominance, and real-weighted APSP Raphael Yuster University of Haifa.
Graph-02.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 2 Some of the sides are exported from different sources.
Presented by Yuval Shimron Course
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
Noga Alon Institute for Advanced Study and Tel Aviv University
1 Maximum matching in graphs with an excluded minor Raphael Yuster University of Haifa Uri Zwick Tel Aviv University TexPoint fonts used in EMF. Read the.
Matrix sparsification (for rank and determinant computations) Raphael Yuster University of Haifa.
1 On Dynamic Shortest Paths Problems Liam Roditty Uri Zwick Tel Aviv University ESA 2004.
1 Fast Sparse Matrix Multiplication Raphael Yuster Haifa University (Oranim) Uri Zwick Tel Aviv University ESA 2004.
1 Finding cycles using rectangular matrix multiplication and dynamic programming Raphael Yuster Haifa Univ. - Oranim Uri Zwick Tel Aviv University Uri.
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
An almost linear fully dynamic reachability algorithm.
1 Approximate Distance Oracles Mikkel Thorup AT&T Research Uri Zwick Tel Aviv University.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Liam Roditty Reachability in Directed Graphs. Connectivity in undirected graphs Given two vertices decide whether they are in the same component. Reachability.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
1 A fast algorithm for Maximum Subset Matching Noga Alon & Raphael Yuster.
All-Pairs Bottleneck Paths in Vertex Weighted graphs Asaf Shapira Microsoft Research Raphael Yuster University of Haifa Uri Zwick Tel-Aviv University.
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
Data Structures Week 9 Introduction to Graphs Consider the following problem. A river with an island and bridges. The problem is to see if there is a way.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Analysis of Algorithms Spring semester 2002 Uri Zwick
Exponential time algorithms Algorithms and networks.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
Approximation algorithms
Complexity Classes.
Theoretical analysis of time efficiency
EECS 203 Lecture 19 Graphs.
Çizge Algoritmaları.
Chapter 9 (Part 2): Graphs
Applied Discrete Mathematics Week 13: Graphs
Analysis of algorithms
Finding Cycles and Trees in Sublinear Time
Lecture 22 Complexity and Reductions
EECS 203 Lecture 20 More Graphs.
Algorithms and Networks
CS4234 Optimiz(s)ation Algorithms
Chapter 2 Fundamentals of the Analysis of Algorithm Efficiency
CS200: Algorithm Analysis
CSE 421: Introduction to Algorithms
ICS 353: Design and Analysis of Algorithms
Parameterised Complexity
Graph Theory.
Relations (sections 7.1 – 7.5)
Approximate Distance Oracles and Spanners with sublinear surplus
CS100: Discrete structures
On the effect of randomness on planted 3-coloring models
Analysis of Algorithms
Analysis of Algorithms
Approximate Distance Oracles
Fast Sparse Matrix Multiplication
Let us switch to a new topic:
Reachability in Directed Graphs
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
Proof Techniques.
Graphs G = (V, E) V are the vertices; E are the edges.
Analysis of algorithms
Answering distance queries in directed graphs using fast matrix multiplication Raphael Yuster Haifa University Uri Zwick Tel Aviv University.
15th Scandinavian Workshop on Algorithm Theory
Graph Theory: Proof Techniques
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Concepts of Computation
Locality In Distributed Graph Algorithms
Analysis of Algorithms
Lecture 22 Complexity and Reductions
Presentation transcript:

Raphael Yuster Haifa University Uri Zwick Tel Aviv University Finding cycles using rectangular matrix multiplication and dynamic programming … Raphael Yuster Haifa University Uri Zwick Tel Aviv University

Matrix multiplication  = Authors Complexity folklore n3 Strassen (1969) n2.81 Coppersmith, Winograd (1990) n2.38 ??? n

Rectangular Matrix multiplication b a  = b a a c a b  = c b M(a,b,c) = M(b,c,a) = M(c,a,b) = ...

Rectangular Matrix multiplication b c c  = a a There are also improved specially designed rectangular matrix multiplication algorithms

Chain Matrix Product Let Ai be an ni ni+1 matrix. Compute A1A2…Ak. Matrix multiplication is associative, so all association orders give the same result, but may have vastly different cost. Easy to solve using dynamic programming.

Chain Matrix Product (cont.) Let P(i,j) be the cost of computing Ai…Aj. 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.

Does the graph contain a triangle? Finding triangles A triangle A graph Does the graph contain a triangle? Yes!

Algorithms for finding triangles Let A be the adjacency matrix of a graph G. Then, G contains a triangle iff A2AT≠0. Authors Running time folklore mn n < n2.38 Itai-Rodeh ’78 m3/2 AYZ ’97 m2 /(+1) < m1.41

Finding triangles in O(m2 /(+1)) time [AYZ ’97] Let  be a parameter. . High degree vertices: vertices of degree  . Low degree vertices: vertices of degree < . There are at most 2m/ high degree vertices =

A graph G contains a Ck iff Ak-1AT≠0 ? Finding longer cycles A graph G contains a Ck iff Ak-1AT≠0 ? We want simple cycles!

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.

Finding C2k in O(m2-1/k) time [AYZ ’97] Let  be a parameter. . High degree vertices: vertices of degree  . Low degree vertices: vertices of degree < . There are at most 2m/ high degree vertices = Finding paths of length k Finding a cycle passing through a high degree vertex

Algorithms for finding a Ck Authors Running time Monien ’85 mn AYZ ’95 n < n2.38 AYZ ’97 m2-1/k/2 [AYZ ’97]: “We have not been able to use fast matrix multiplication to obtain faster algorithms for finding Ck, for k4, in sparse graphs.”

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 on: Finding odd cycles עוד יותר מהר

Algorithms for finding a C4 Authors Running time Monien ’85 mn AYZ ’95 n < n2.38 AYZ ’97 m3/2 Eisenbrand, Grandoni ’03 m 2-2/ n1/ YZ ’03 m(4-1)/(2+1)<m1.48

Finding C4’s 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 < . There are at most 2m/ high degree vertices

Finding C4’s in O(m 2-2/ n1/) time [EG ’03]

Finding C4’s 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) <  Low degree vertices: deg(v) < 1/2 There are at most 2m/ high degree vertices. There are at most 2m/1/2 medium degree vertices.

Finding C4’s in O(m(4-1)/(2+1)) time [YZ ’03]

Where do we go from here? Why just three degree classes? How many cases will we have for C5, C6, …?

The general case Partition the vertices into log n degree classes: Vi={ vV | 2i ≤ deg(v) ≤ 2i+1 } Number of cycle classes is only (log n)k. What is the most efficient way of handling each class?

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.

Finding paths We get a chain matrix product problem! Degree: Size of class: We get a chain matrix product problem! We can use the sparsity of the matrices.

It is convenient to express everything as a power of m. Finding paths (cont.) It is convenient to express everything as a power of m. Degree: Size of class:

Finding cycles Theorem: There is an time algorithm for finding Ck’s in directed graphs.

Finding C5’s Requires a non-constant number of degree classes. Theorem: Requires a non-constant number of degree classes. The worst-case running time is obtained for regular graphs.

If the conjecture is true, then c6<1.65. Finding C6’s Conjecture: If the conjecture is true, then c6<1.65.

The conjecture holds for k=3,5. Finding odd cycles Conjecture: for odd k3. The conjecture holds for k=3,5.

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?