EECS 495: Randomized Algorithms Lecture 14 Random Walks. j p ij = 1. Pr[X t+1 = j X 0 = i 0,..., X t 1 = i t 1, X t = i] = Pr[X t+

Similar documents
Powerful tool for sampling from complicated distributions. Many use Markov chains to model events that arise in nature.

Probability & Computing

25.1 Markov Chain Monte Carlo (MCMC)

(K2) For sum of the potential differences around any cycle is equal to zero. r uv resistance of {u, v}. [In other words, V ir.]

Lecture 28: April 26

Lecture 2: September 8

6.842 Randomness and Computation February 24, Lecture 6

Markov Chains, Random Walks on Graphs, and the Laplacian

The Markov Chain Monte Carlo Method

Lecture 5: Random Walks and Markov Chain

Random Walks on Graphs. One Concrete Example of a random walk Motivation applications

Two Proofs of Commute Time being Proportional to Effective Resistance

Lecture 6: September 22

1 Random Walks and Electrical Networks

Approximate Counting and Markov Chain Monte Carlo

Definition A finite Markov chain is a memoryless homogeneous discrete stochastic process with a finite number of states.

Coupling. 2/3/2010 and 2/5/2010

18.175: Lecture 30 Markov chains

8. Statistical Equilibrium and Classification of States: Discrete Time Markov Chains

Markov chains. Randomness and Computation. Markov chains. Markov processes

University of Chicago Autumn 2003 CS Markov Chain Monte Carlo Methods

Link Analysis Ranking

Markov Processes Hamid R. Rabiee

CSE525: Randomized Algorithms and Probabilistic Analysis May 16, Lecture 13

Midterm 2 Review. CS70 Summer Lecture 6D. David Dinh 28 July UC Berkeley

Disjointness and Additivity

DATA MINING LECTURE 13. Link Analysis Ranking PageRank -- Random walks HITS

Generating random spanning trees. Andrei Broder. DEC - Systems Research Center 130 Lytton Ave., Palo Alto, CA

Markov Chains CK eqns Classes Hitting times Rec./trans. Strong Markov Stat. distr. Reversibility * Markov Chains

MATH 564/STAT 555 Applied Stochastic Processes Homework 2, September 18, 2015 Due September 30, 2015

Ring Sums, Bridges and Fundamental Sets

Math Homework 5 Solutions

Markov Chains. X(t) is a Markov Process if, for arbitrary times t 1 < t 2 <... < t k < t k+1. If X(t) is discrete-valued. If X(t) is continuous-valued

The Monte Carlo Method

Online Social Networks and Media. Link Analysis and Web Search

Random walk: notes. Contents. December 5, 2017

Lecture 24 Nov. 20, 2014

Markov Chains. Andreas Klappenecker by Andreas Klappenecker. All rights reserved. Texas A&M University

Essentials on the Analysis of Randomized Algorithms

Recap. Probability, stochastic processes, Markov chains. ELEC-C7210 Modeling and analysis of communication networks

1.3 Convergence of Regular Markov Chains

Laplacian eigenvalues and optimality: II. The Laplacian of a graph. R. A. Bailey and Peter Cameron

Quantum walk algorithms

Lecture 10: Lovász Local Lemma. Lovász Local Lemma

PCPs and Inapproximability Gap-producing and Gap-Preserving Reductions. My T. Thai

An Algorithmist s Toolkit September 24, Lecture 5

Markov Chains and Stochastic Sampling

1 Randomized reduction: a first start

Characterization of cutoff for reversible Markov chains

1 Ways to Describe a Stochastic Process

Oberwolfach workshop on Combinatorics and Probability

Model Counting for Logical Theories

Propp-Wilson Algorithm (and sampling the Ising model)

Online Social Networks and Media. Link Analysis and Web Search

Lecture 14: Random Walks, Local Graph Clustering, Linear Programming

5 Flows and cuts in digraphs

INTRODUCTION TO MCMC AND PAGERANK. Eric Vigoda Georgia Tech. Lecture for CS 6505

INTRODUCTION TO MCMC AND PAGERANK. Eric Vigoda Georgia Tech. Lecture for CS 6505

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

CS246: Mining Massive Datasets Jure Leskovec, Stanford University

Homework set 3 - Solutions

0.1 Naive formulation of PageRank

Some Definition and Example of Markov Chain

Electrical networks and Markov chains

CSI 4105 MIDTERM SOLUTION

Random walks, Markov chains, and how to analyse them

Lecture 12: Randomness Continued

Lecture 3: September 10

Lecture 9 Classification of States

The Theory behind PageRank

Lecture: Modeling graphs with electrical networks

An Introduction to Randomized algorithms

The coupling method - Simons Counting Complexity Bootcamp, 2016

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

18.440: Lecture 33 Markov Chains

Dominating Set. Chapter 7

NP-Complete Problems. More reductions

18.600: Lecture 32 Markov Chains

Introducing the Laplacian

Continuous-time Markov Chains

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

6 Markov Chain Monte Carlo (MCMC)

Notes 6 : First and second moment methods

Lecture Space Bounded and Random Turing Machines and RL

1 Maintaining a Dictionary

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

Breadth-First Search of Graphs

6.207/14.15: Networks Lectures 4, 5 & 6: Linear Dynamics, Markov Chains, Centralities

Out-colourings of Digraphs

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Markov Chains and MCMC

6.042/18.062J Mathematics for Computer Science December 14, 2004 Tom Leighton and Eric Lehman. Final Exam

Discrete quantum random walks

Random Walks on graphs

CS 781 Lecture 9 March 10, 2011 Topics: Local Search and Optimization Metropolis Algorithm Greedy Optimization Hopfield Networks Max Cut Problem Nash

Graph fundamentals. Matrices associated with a graph

Introduction to Algorithms

2 Fundamentals. 2.1 Graph Theory. Ulrik Brandes and Thomas Erlebach

25 Minimum bandwidth: Approximation via volume respecting embeddings

Transcription:

EECS 495: Randomized Algorithms Lecture 14 Random Walks Reading: Motwani-Raghavan Chapter 6 Powerful tool for sampling complicated distributions since use only local moves Given: to explore state space. state space S 2SAT Markov Chain initial distribution of states Given 2SAT formula, Fix satisfying assignment A Pick random unsatisfied clause, and flip one of its vars at random matrix P of transition probabilities p ij for i, j S as prob. transition from i to j Interpret as directed graph. Compare to 2SAT example. Note: Properties: Let f(k) be expected time to get all n variables to match A if k currently match f(n) = 0, f(0) = 1 + f(1) f(k) = 1 + 1 (f(k + 1) + f(k 1)) 2 Rewrite: f(0) f(1) = 1 and f(k) f(k + 1) = 2 + f(k 1) f(k) [[Intrepret as walk on a line. ]] j p ij = 1 memoryless: Pr[X t+1 = j X 0 = i 0,..., X t 1 = i t 1, X t = i] = Pr[X t+ where X t is rand var of state at time t If X t has dist q (q i is prob of state i), then X t+1 has dist qp Conclude: f(k) f(k + 1) = 2k + 1 so f(0) = n 1 k=0 (f(k) f(k + 1)) = Pr[X t+r = j X t = i] = P 1 + 3 +... + (2n 1) = n 2 ij r [[recall geometric argument Def: ]] The stationary distribution is a π s.t. πp = π (i.e., left eigenvector with eigenvalue Find with probability 1/2 in time 2n 2 by 1). Markov Stationary distribution is sample from state space, so to sample from a set of Find whp in O(n 2 log n) time 1 objects, define chain with correct stationary dist. When does this work? Question: Stationary distributions for

2-cycle? no stationary dist. disconnected graph? multiple stationary dist. Def: A Markov chain is irreducible if any state can reach any other state. I.e., path between any two states single strong component Persistent/Transient states: r t ij is prob. first hit j at t given start in state i f ij is prob. eventually reach j from i, so t rt ij expected time is hitting time { h ij = t trt ij : f ij = 1 : f ij < 1 Def: If f ii < 1, state i is transient, else persistent. If h ii =, null persistent, else nonnull persistent. Note: In finite irreducible chain, all states non-null persistent. Periodicity: max T s.t. state only has non-zero prob. at times a + T i for integer i chain aperiodic if no state has periodicity more than 1 Claim: Fundamental theorem of Markov chains: Any irreducible, finite, aperiodic Markov chain satisfies: All states ergodic Since finite irreducible implies non-null persistent. unique stationary distribution π with π i > 0 for all i f ii = 1 and h ii = 1/π i for all i Since hit every 1/h ii steps on average. number of times visit i in t steps approaches tπ i in limit of t From linearity of expectation. Random Walks Markov chains on (connected, non-bipartite) undirected graphs: states are vertices {u} with degrees d(u) move to uniformly chosen neighbor so p uv = 1/d(u) for every neighbor v of u Claim: unique stationary dist.: π v = d(v)/2m Proof: System of equations: π v = u π u P uv Example: bipartite graph periodic, graph with self loops aperiodic and π u = 1 Def: A state is ergodic if it is aperiodic and non-null persistent. has soln as stated, unique by fundamental theorem of markov chains. Chance of being in state at any sufficiently far future time. Claim: h vv = 1/π v = 2m/d(v) 2 u

Def: Commute time is h uv + h vu. Def: Cover time is max u C u (G) where C u (G) is expected length of random walk that starts at u and ends after visiting each vertex once. Question: What do you expect to have bigger commute/cover times? clique, line, lollipop Note for clique, like coupon collector, commute O(n), cover O(n log n). Note: Adding edges can increase cover time though improves connectivity! Claim: For edge (u, v), h uv + h vu 2m. Proof: Define new MC: 2m states: pair of edge, direction edge most recently traversed, direction traversed in transitions Q (u,v),(v,w) = P vw = 1/d(v) Note Q is doubly stochastic: col/row sums are 1 since d(v) edges transit to (v, w) each with prob. 1/d(v) so uniform stationary dist π e = 1/2m, so h ee = 2m. Hence in original chain: if arrived via (u, v), will traverse (u, v) again in 2m steps conditioned on arrival edge, commute time 2m memoryless, so can remove conditioning Note: Bound is for an edge of chain. Claim: Cover time O(mn). Proof: Consider dfs of spanning tree: gives order on vertices time for two adj. vertices to be visited in this order O(m) by bound on commute times total time O(mn) Claim: Tighter analysis C uv = 2mR uv where R uv is effective resistance in electrical network of graph with 1 unit of resistance on each edge. Claim: Kirchhoff s Law: conservation of current Claim: Ohm s Law: voltage across resistance equals product of resistance and current Def: Effective resistance between u and v is voltage diff when one ampere injected into u and removed from v. Proof: (of claim): put d(x) amperes into every x, remove 2m from v φ uv voltage at u w.r.t. v Ohm: current from u to neighbor w is φ uv φ wv Kirchoff: d(u) = w N(u) φ uv φ wv = d(u)φ uv φ wv Also h uv = (1/d(u))(1 + h wv ) so d(u)h uv = d(u) + w h wv so φ uv = h uv h vu = φ vu when insert 2m at u and remove d(x) from every x h uv + h vu is voltage diff. when insert 2m at u and remove at v Result follows from Ohm s law. 3

Corollary 0.1 Effective resistance at most shortest path, so C uv n 3 for any connected graph. A drunk man gets home visiting every bar in town in time n 3. Example: line graph: h 0n = h n0 and h 0n + h n0 = 2mR 0n = 2n 2, so h 0n = n 2. lollipop: h uv + h vu = 2Θ(n 2 )Θ(n) = Θ(n 3 ) and from line, h uv = Θ(n 2 ) so h vu = Θ(n 3 ) (so extra factor n is latency getting started on line). Hitting/cover times not monotonic w.r.t. adding edges: line to lollipop to clique. Applications Randomized st-connectivity In log-space walk randomly for O(n 3 ) steps irreducible? yes, any perm is product of transpositions aperiodic? yes, self loops also reversible, i.e., P xy = P yx so doubly stochastic so stationary dist. is uniform shuffle cards if repeat enough. Top-to-random: Take top card, insert at random place. irreducible and aperiodic not reversible, but each perm has indegree n and out-degree n so doubly stochastic and π is uniform shuffle cards if repeat enough. Riffle shuffle: split deck into two parts using binomial dist. drop cards in sequence where card comes L from left hand w/prob. (random L + R interleave) need to store, current vertex, destination vertex, number of steps Note: In deterministic log-space by Reingold (STOC 05)! Uses ideas from derandomization, e.g., expanders. Same year, best student paper of Vladimir Trifonov did deterministic O(log n log log n) space, now at UIC. Also has stationary dist. Key issue is mixing time (time to get close to stationary dist from any starting state): top-to-random has O(n log n) mixing time riffle has O(log n) mixing time seven shuffles theorem Card shuffling Random transposition: Pick two cards i and j and switch. Technique coupling: particles move on chain and if ever appear together, then get joined forevermore pair of processes (X t, Y t ) 4

each of (X t, ) and (, Y t ) look like MC (Pr[X t+1 = j X t = i] = P ij ) if X t = Y t then X t+1 = Y t+1 Mixing time is related to time to couple: max dist to stationary at time t is (t) max dist between dist starting at x and y is p t x p t y this is at most prob. X t and Y t haven t coupled given start at x and y Example: top-in-at-random: Define reverse chain: pick card c uniformly at random and move to top same mixing time. Coupling: X t and Y t pick same c (which may be at different positions) Fact: Once card chosen in coupling, always in same position in both decks. So coupling/mixing time O(n log n) by coupon collector. 2. Above chain mixing time O(n log n) whenever at least + 2 colors Claim: Mixing time O(n log n) if at least 4 + 1 colors. Proof: Coupling is both chains pick same vertex v and color c. Let d t be number of vertices where disagree, q be number colors. Good moves: color of v disagrees, c legal in both graphs. at least d t (q 2 ) good moves. Bad moves: chosen vertex doesn t disagree, but neighbors disagreeing vertex v and color c is color of v in one of graphs and not other. at most 2d t bad moves Neutral moves: everything else Diff between good and bad at least d t (q 4 ), so expect distance to decrease when q 4 + 1. Counting perfect matchings Sampling colorings Markov chain: pick vertex and color at random and recolor if legal. symmetric, aperiodic, irreducible if at least + 2 colors Important conjectures: 1. Random sampling polytime whenever q + 1 5