Download presentation
Presentation is loading. Please wait.
Published byMarylou Malone Modified over 9 years ago
2
2
4
4 Theorem:Proof: What shall we do for an undirected graph?
5
5
6
6
7
7 p 0 (s)=1 p 1 (a)=1/3
8
8
9
9
10
10
11
11
12
12
13
Note that if the right answer is ‘NO’, we clearly answer ‘NO’. Hence, this random walk algorithm has one-sided error. Such algorithms are called “Monte-Carlo” algorithms. Complexi ty 13
14
14 st... The probability we head in the right direction is 1/d i Every visit here, is another chance!
15
Since expectedly we return to each vertex within 2|E|/d i steps The walk expectedly heads in the right direction within 2|E| steps By linearity of the expectation, it is expected to reach t within d(s,t) 2|E| 2|V| |E| steps. 15 Complexity
16
1. Run the random walk from s. 2. Once vertex t is visited, halt and accept --- “there is a path from s to t”. 3. Once ran for 8|V| |E| steps halt and reject --- “there is probably no path from s to t”. The claim is true –by Markov– with probability ≥¼. 16 Complexity
17
Theorem: The above algorithm - uses logarithmic space - always right for ‘NO’ instances. - errs with probability at most ½ for ‘YES’ instances. 17 Complexity To maintain the current position we only need log|V| space Markov: Pr(X>2E[X])<½ PAP 401-404
18
We explored the undirected connectivity problem. We saw a log-space randomized algorithm for this problem. We used an important technique called random walks. 18 Complexity
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.