Mazes - PowerPoint PPT Presentation

About This Presentation
Title:

Mazes

Description:

Undirected Connectivity. Instance: An undirected graph G=(V,E) and two vertices s,t ... We explored the undirected connectivity problem. ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 24
Provided by: csta3
Category:

less

Transcript and Presenter's Notes

Title: Mazes


1
Mazes
  • And Random Walks

2
Can You Solve This Maze?
3
The Solution
4
What Will We Do?
  • Our task is to show an algorithm for general
    mazes.
  • We have memory which is logarithmic in the size
    of the maze.

5
Introduction
  • Objectives
  • To explore the undirected connectivity problem
  • To introduce randomized computations
  • Overview
  • Undirected Connectivity
  • Random Walks

6
Undirected Connectivity
  • Instance An undirected graph G(V,E) and two
    vertices s,t?V
  • Problem To decide if there is a path from s to t
    in G

7
What Do We Know?
  • Theorem
  • Directed Connectivity is NL-Complete
  • Corollary
  • Undirected Connectivity is in NL.

8
Undirected Connectivity is in NL Revisit
  • Our non-deterministic algorithm

At each node, non-deterministically choose a
neighbor and jump to it
9
What If We Dont Have Magic Coins?
  • Non-deterministic algorithms use magic coins
    to lead them to the right solution if one exists.
  • In real life, these are unavailable

10
Idea!
  • What if we have plain coins?
  • In other words, what if we randomly choose a
    neighbor?

11
Random Walks
  • Add a self loop to each vertex.
  • Start at s.
  • Let di be the degree of the current node.
  • Jump to each of the neighbors with probability
    1/di.
  • Stop if you get to t.

12
Notations
  • Let vt denote the node visited at time t (v0s).
  • Let pt(i) Prvti

p1(a)0.5
p0(s)1
13
Stationary Distribution
  • Lemma
  • If G(V,E) is a connected graph,
  • for any i?V,

14
Weaker Claim
  • Well prove a weaker result
  • Lemma If for some t, for any i?V,
  • then for any i?V,

15
Proof
  • Proof ?di2E. If the ith node has weight di at
    time t, then it retains this weight at time t1
    (its reachable (only) from its di neighbors). ?

16
Illustrated Proof
17
Using the Asymptotic Estimate
  • Corollary Starting from some node i, we will
    revisit i within expectedly 2E/di steps.
  • Proof Since the walk has no memory, the
    expected return time is the same as the
    asymptotic estimate?

18
One-Sided Error
  • Note that if the right answer is NO, we clearly
    answer NO.
  • Thus, a random walk algorithm has one-sided
    error.
  • Such algorithms are called Monte-Carlo
    algorithms.

19
How Many Steps Are Needed?
  • If the right answer is YES, in how many steps
    do we expect to discover that?

But every time we get here, we get a second
chance!
The probability we head in the right direction is
1/ds
20
How Many Steps Are Needed?
  • Since expectedly we return to each vertex after
    2E/di steps,
  • We expect to head in the right direction after
    E steps (w.p. ½).
  • By the linearity of the expectation, we expect to
    encounter t in d(s,t)?E?V?E steps.

21
Randomized Algorithm for Undirected Connectivity
  1. Run the random walk from s for 2V?E steps.
  2. If node t is ever visited, answer there is a
    path from s to t.
  3. Otherwise, reply there is probably no path from
    s to t.

22
Main Theorem
PAP 401-404
  • Theorem The above algorithm
  • uses logarithmic space
  • always right for NO instances.
  • errs with probability at most ½ for YES
    instances.

To maintain the current position we only need
logV space
Markov Pr(Xgt2EX)lt½
23
Summary
?
  • We explored the undirected connectivity problem.
  • We saw a log-space randomized algorithm for this
    problem.
  • We used an important technique called random
    walks.
Write a Comment
User Comments (0)
About PowerShow.com