Randomized algorithms cs648
Download
1 / 36

Randomized Algorithms CS648 - PowerPoint PPT Presentation


  • 125 Views
  • Uploaded on

Randomized Algorithms CS648. Lecture 18 A pproximate Distance Oracles Algorithm for Min-cut : part 1. Approximate Distance oracles. All-Pairs Shortest Paths. Notations and Terminologies : A graph on vertices edges A path from to : a sequence , ,…, where ( , )

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Randomized Algorithms CS648' - kalkin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Randomized algorithms cs648

Randomized AlgorithmsCS648

Lecture 18

Approximate Distance Oracles

Algorithm for Min-cut : part 1



All pairs shortest paths
All-Pairs Shortest Paths

Notations and Terminologies :

A graph on

  • vertices

  • edges

    A pathfrom to : a sequence , ,…,where (,)

    Length of a path : sum of the weights on the edges of path .

    Shortest path from to : the path of smallest length from to .

    Distancefrom to : the length of the shortest path from to .

    : Distance from to


All pairs shortest paths1
All-Pairs Shortest Paths

Problem Definition: Given a graph , build a compact data structure so that for any ,

  • can be reported in time

  • Shortest path from to can be reported in optimal time.

    Results known:

  • size data structure

    (Distance matrix and Witness matrix)

  • preprocessing time

    (Dijkstra’s algorithm from each vertex)

    Current-state-of-the-art RAM size: 8 GBs

    Can’t handle graphs with even vertices (with RAM size) 


All pairs approximate shortest paths
All-Pairs Approximate Shortest Paths

Problem Definition: Given a graph , build a compact data structure so that for any , it reports in time satisfying

: stretch.

Aim: To achieve

  • Sub-quadratic space.

  • Sub-cubic preprocessing time.

    With query time.

    Many elegant results have been invented for undirected graphs 


A truly magical result
A truly magical result

Approximate Distance Oracles

MikkelThorupand Uri Zwick:

Approximate Distance Oracles for graphs,

Journal of ACM (4), 2005


Inspiration from our daily life
Inspiration from our daily life



The idea
The Idea

Given a graph ,

  • Compute a small set of Landmark vertices.

  • From each vertex , store distance to vertices present in its locality.

  • From each vertex , store distance to all vertices in the graph.

    Questions:

  • What is the formal notion of locality?

  • How to retrieve distance from to a far away vertex ?

  • What is the guarantee of stretch ?

  • How to compute the desired set efficiently ?


Formal notion of locality
Formal notion of locality


Formal notion of locality1
Formal notion of locality

= {}


Reporting distance from
Reporting distance from

Report


What is the stretch

stretch

What is the stretch ?

??


3 approximate distance oracle
3-approximate distance oracle

Preprocessing-algorithm()

{ Compute set suitably;

For each store distance to all vertices;

For each

compute ;

Build a hash table storing distances from to ;

}

Query(,)

{ If return ;

else return ;

}

Global distance info.

Local distance info.


The real challenge left
The real challenge left

How to compute set such that

  • is small.

  • is small for each .

    Fact1: It is difficult, if not impossible, to compute such a set deterministically.

    Fact2: The structure of graph (the edges and weights) can be arbitrary and more complex than planar road/air networkk.



Conquering the challenge
Conquering the challenge

Let be a fraction to be fixed later on.

Computing:

{ ∅;

For each

Add to independently with probability ;

return ;

}

Expected size of :

  • : random variable for ||


Expected size of
Expected size of

=

… …

Increasing order of distance from

None of is present in


Expected space of 3 approximate distance oracle
Expected space of 3-approximate distance oracle

Space for Global distance information:

=

=

=

Spacefor Local distance information:

=

=

To minimize the total space: (Balance the two terms)

Expected space:

Each vertex in keeps a Ball)


Theorem: An undirected weighted graph can be processed to build a data structure of expected size that can report 3-approximate distance between any pair of vertices in time.

Homework:

  • Convert to a Las Vegas algorithm with high probability bound on space.

  • Show that expected preprocessing time is


5 approximate distance oracle

Meant for only those (hopefully nonzero no. of) students whose aim is more than just a good grade in this course.

5-approximate distance oracle


3 approximate distance oracle1
3 whose aim is more than just a good grade in this course. -approximate distance oracle


5 approximate distance oracle1
5 whose aim is more than just a good grade in this course. -approximate distance oracle


5 approximate distance oracle2
5 whose aim is more than just a good grade in this course. -approximate distance oracle


Problem 2 min cut
problem 2 whose aim is more than just a good grade in this course. Min-cut


Min cut
Min-Cut whose aim is more than just a good grade in this course.

: undirected connected graph

Definition (cut):

A subset whose removal disconnects the graph.

Definition (min-cut): A cut of smallest size.

Problem Definition:Design algorithm to compute min-cut of a given graph.


Min cut1
Min-Cut whose aim is more than just a good grade in this course.

Deterministic Algorithms:

  • time

    - Designed in 1997,

    - Quite complex to analyze and implement

    Randomized Algorithms:

  • time Monte Carlo [1993]

  • time Monte Carlo [1996]

    - Both are much simpler and easier to implement.


Some basic facts
some basic facts whose aim is more than just a good grade in this course.


Min cut2
Min-Cut whose aim is more than just a good grade in this course.

Question: How many cuts ?

Answer:

Question : what is relation between degree() and size of min-cut ?

Answer: size of min-cut degree()

Question : If size of min-cutis , what can be minimum value of ?

Answer:


Contract
Contract whose aim is more than just a good grade in this course. ()

Contract(


Contract1
Contract whose aim is more than just a good grade in this course. ()

Contract()

{ Let ;

Merge the two vertices and into one vertex;

Preserve multi-edges;

Remove the edge ;

Let be the modified graph;

return ;

}

Time complexity of Contract():


Contract2
Contract whose aim is more than just a good grade in this course. ()

Let be the size of min-cut of .

Let be any min-cut of .

Let be the graph after Contract().

Observation: Every cut of is also a cut of .

Question: Under what circumstance is a cut of ?

Answer: if .

Question: If is selected randomly uniformly, what is the probability that is preserved in ?

Answer:


Contract3
Contract whose aim is more than just a good grade in this course. ()

Let be the size of min-cut of .

Let be any min-cut of .

Lemma: If edge to be contracted is selected randomly uniformly, is preserved with probability at least .

Let ;

Contract().

Let ;

Contract().

Question: What is probability that is preserved in ?

Answer:


Algorithm for min cut
Algorithm for min-cut whose aim is more than just a good grade in this course.

Min-cut():

{ Repeat ?? times

{

Let ;

Contract().

}

return the edges of multi-graph ;

}

Running time:


Algorithm for min cut1
Algorithm for min-cut whose aim is more than just a good grade in this course.

Question: What is probability that is preserved during the algorithm ?

Answer:

=

=

>


Algorithm for min cut2
Algorithm for min-cut whose aim is more than just a good grade in this course.

Min-cut-high-probability():

{ Repeat Min-cut() algorithm log times

and report the smallest cut computed;

}

Running time:

Error Probability :

<


ad