Randomness in Computing L ECTURE 26 Last time Randomized algorithm - - PowerPoint PPT Presentation

โ–ถ
randomness in computing
SMART_READER_LITE
LIVE PREVIEW

Randomness in Computing L ECTURE 26 Last time Randomized algorithm - - PowerPoint PPT Presentation

Randomness in Computing L ECTURE 26 Last time Randomized algorithm for 3SAT Gamblers ruin Classification of Markov chains Today Stationary distributions Random walks on graphs Algorithm for - -PATH 4/23/2020


slide-1
SLIDE 1

4/23/2020

Randomness in Computing

LECTURE 26

Last time

  • Randomized algorithm for 3SAT
  • Gamblerโ€™s ruin
  • Classification of Markov chains

Today

  • Stationary distributions
  • Random walks on graphs
  • Algorithm for ๐‘ก-๐‘ข-PATH

Sofya Raskhodnikova;Randomness in Computing; based on slides by Baranasuriya et al.

slide-2
SLIDE 2

Classification of Markov chains

  • A finite Markov chain is irreducible if its graph representation

consists of one strongly connected component.

  • A state ๐‘˜ is periodic if there exists an integer ฮ” > 1 such that

Pr ๐‘Œ๐‘ข+๐‘ก = ๐‘˜ ๐‘Œ๐‘ข = ๐‘˜ = 0 unless ๐‘ก is divisible by ฮ” ; otherwise, it is aperiodic.

  • A Markov chain is aperiodic if all its states are aperiodic.

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

slide-3
SLIDE 3

Stationary Distributions

Recall: าง ๐‘ž ๐‘ข + 1 = าง ๐‘ž ๐‘ข ๐‘ธ, where าง ๐‘ž ๐‘ข is the distribution of the state

  • f the chain at time ๐‘ข and ๐‘ธ is its transition probability matrix.
  • A stationary distribution of a Markov chain is a probability

distribution เดค ๐œŒ such that เดค ๐œŒ = เดค ๐œŒ๐‘ธ.

(Describes steady state behavior of a Markov chain.) Example: Define Markov chain by the following random walk on the nodes of an ๐‘œ-cycle. At each step, stay at the same node w.p. ยฝ; go left w.p. ยผ and right w.p. ยผ.

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

slide-4
SLIDE 4

Fundamental theorem

  • A stationary distribution of a Markov chain is a probability

distribution เดค ๐œŒ such that เดค ๐œŒ = เดค ๐œŒ๐‘ธ.

(Describes steady state behavior of a Markov chain.)

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

Fundamental Theorem of Markov Chains (selected items)

Every finite, irreducible and aperiodic Markov chain satisfies the following: 1. There is a unique stationary distribution เดค

๐œŒ = (๐œŒ0, ๐œŒ_1, โ€ฆ , ๐œŒ๐‘œ), where

๐œŒ๐‘— > 0 for all ๐‘— โˆˆ [๐‘œ]. 2. For all ๐‘— โˆˆ [๐‘œ], the hitting time โ„Ž๐‘—๐‘— = 1/๐œŒ๐‘—.

slide-5
SLIDE 5

Random walks on undirected graphs

Given a connected, undirected graph ๐ป = (๐‘Š, ๐น), define the following Markov chain

  • states = vertices of the graph
  • from each state ๐‘ค, the chain moves to a uniformly random

neighbor of ๐‘ค ๐‘„

๐‘ฃ๐‘ค = แ‰

1 ๐‘’ ๐‘ฃ if ๐‘ฃ, ๐‘ค โˆˆ ๐น

  • therwise
  • Observation: This Markov chain is aperiodic iff G isnโ€™t bipartite.

4/23/2020

Sofya Raskhodnikova; Randomness in Computing

slide-6
SLIDE 6

Stationary distribution

  • Assume ๐ป is not bipartite.

4/23/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

A random walk on ๐ป has stationary distribution เดค ๐œŒ, where เท

๐‘คโˆˆ๐‘Š

๐œŒ๐‘ค = ๐‘’(๐‘ค) 2|๐น|

slide-7
SLIDE 7

Hitting time, commute time, cover time

  • The hitting time from ๐‘ฃ to ๐‘ค, denoted โ„Ž๐‘ฃ,๐‘ค, is the expected time to

reach state ๐‘ค from state ๐‘ฃ.

  • The commute time between ๐‘ฃ and ๐‘ค is โ„Ž๐‘ฃ,๐‘ค + โ„Ž๐‘ฃ,๐‘ค.
  • The cover time of a graph ๐ป = (๐‘Š, ๐น) is the maximum over ๐‘ค โˆˆ ๐‘Š
  • f the expected time for a random walk starting at ๐‘ค to visit all

nodes in ๐‘Š.

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

slide-8
SLIDE 8

Bound on commute time

Proof: Let ๐ธ = set of 2|๐น| directed edges ๐’‹ โ†’ ๐’Œ ๐‘—, ๐‘˜ โˆˆ ๐น}

  • Random walk on ๐ป corresponds to Markov Chain with states ๐ธ,

where state at time ๐‘ข is the directed edge taken by transition ๐‘ข.

  • This Markov Chain has uniform stationary distribution.

4/23/2020

Sofya Raskhodnikova; Randomness in Computing

Commute Time Lemma

If ๐‘ฃ, ๐‘ค โˆˆ ๐น, the commute time โ„Ž๐‘ฃ,๐‘ค + โ„Ž๐‘ค,๐‘ฃ is at most 2 ๐น .

๐’‹ ๐’Œ ๐’‹ ๐’Œ ๐’‹ ๐’Œ ๐’ ๐’‹ โ†’ ๐’Œ ๐’Œ โ†’ ๐’ ๐Ÿ ๐’† ๐’Œ

slide-9
SLIDE 9

Bound on commute time

Proof: This Markov Chain has uniform stationary distribution.

  • By Fundamental Thm of Markov Chains, โ„Ž๐‘ฃโ†’๐‘ค,๐‘ฃโ†’๐‘ค =

1 2|๐น|

= expected time to traverse ๐‘ฃ โ†’ ๐‘ค starting at ๐‘ฃ โ†’ ๐‘ค = expected time to go from ๐‘ค to ๐‘ฃ and then traverse ๐‘ฃ, ๐‘ค

  • But this is only one way to go from ๐‘ค to ๐‘ฃ to ๐‘ค:

โ„Ž๐‘ค,๐‘ฃ + โ„Ž๐‘ฃ,๐‘ค โ‰ค 1 2|๐น|

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

Commute Time Lemma

If ๐‘ฃ, ๐‘ค โˆˆ ๐น, the commute time โ„Ž๐‘ฃ,๐‘ค + โ„Ž๐‘ค,๐‘ฃ is at most 2 ๐น .

๐’— ๐’˜ ๐’— โ†’ ๐’˜ ๐’˜ โ†’ ๐’™

slide-10
SLIDE 10

Bound on cover time

Proof: Choose a spanning tree ๐‘ˆ of ๐ป.

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

Cover Time Lemma

The cover time of ๐ป with ๐‘œ nodes and ๐‘› edges is at most 2๐‘›(๐‘œ โˆ’ 1).

slide-11
SLIDE 11

Application: ๐’•-๐’–-PATH

Problem: Given an undirected graph ๐ป with ๐‘œ nodes and ๐‘› edges and two nodes, ๐‘ก and ๐‘ข, determine if ๐ป contains a path from ๐‘ก to ๐‘ข.

  • Can be solved by BFS in ๐‘ƒ(๐‘› + ๐‘œ) time
  • This approach requires ฮฉ(๐‘œ) space.
  • Today: a randomized algorithm that uses ๐‘ƒ(log ๐‘œ) space.

Less space than it takes to store a path!

4/26/2020

Sofya Raskhodnikova; Randomness in Computing

  • 1. Start a random walk from ๐‘ก.
  • 2. If the walk reaches ๐‘ข in 2๐‘œ3 steps, accept; otherwise, reject.

Algorithm for ๐‘ก-๐‘ข-PATH

slide-12
SLIDE 12

Correctness of ๐’•-๐’–-PATH algorithm

Proof: If there is no path, the algorithm correctly rejects.

  • Suppose there is an ๐‘ก-๐‘ข path.
  • The expected time to reach ๐‘ข from ๐‘ก is at most the expected cover

time of the connected component, which is, by Cover Lemma is โ‰ค 2๐‘›๐‘œ โ‰ค ๐‘œ3.

  • By Markovโ€™s inequality, the probability that the walk takes more

than 2๐‘œ3 steps to reach ๐‘ข is at most 1/2. Space analysis: Need to keep

  • current position: ๐‘ƒ(log ๐‘œ) bits
  • counter for the number of steps: ๐‘ƒ(log ๐‘œ) bits

4/28/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

The algorithm uses ๐‘ƒ(log ๐‘œ) bits and has error probability โ‰ค 1/2.