Randomized Algorithms 南京大学 尹一通
Markov Chain X 0 , X 1 , X 2 , . . . 1 1 1 / 3 2 1 / 3 1 / 3 3 2 / 3 1 / 3 M = ( Ω , P ) π ( t ) = π (0) P t
1 2 1 2 3 2 1 3 reducible 1 4 1 1 3 1 / 3 2 3 4 1 4 4 1 / 3 1 / 3 3 2 / 3 1 / 3 1 periodic 1
Fundamental Theorem of Markov Chain: If a finite Markov chain is irreducible and M = ( Ω , P ) π (0) aperiodic , then ∀ initial distribution t →∞ π (0) P t = π lim where is a unique stationary distribution satisfying π π P = π
Fundamental Theorem of Markov Chain: If a finite Markov chain is irreducible and M = ( Ω , P ) π (0) aperiodic , then ∀ initial distribution t →∞ π (0) P t = π lim where is a unique stationary distribution satisfying π π P = π finiteness existence (Perron-Frobenius) irreducibility uniqueness ) ) (coupling) ergodicity convergence
Fundamental Theorem of Markov Chain: If a Markov chain is irreducible and M = ( Ω , P ) π (0) ergodic , then ∀ initial distribution t →∞ π (0) P t = π lim where is a unique stationary distribution satisfying π π P = π ergodic : aperiodic + non-null persistent
PageRank Rank: importance of a page • A page has higher rank if pointed by more high - rank pages. • High - rank pages have greater influence. • Pages pointing to few others have greater influence.
PageRank ( simplified ) G ( V, E ) rank of a page: r ( v ) the web graph r ( u ) � r ( v ) = d + ( u ) u :( u,v ) ∈ E d + ( u ) : out - degree of u � 1 if ( u, v ) ∈ E, d + ( u ) P ( u, v ) = random walk: 0 otherwise . a tireless stationary distribution: rP = r random surfer
Random Walk on Graph • undirected graph G ( V , E ) • walk: v 1 , v 2 , . . . ∈ V that v i +1 ∼ v i • random walk: v i +1 is uniformly chosen from N ( v i ) � 1 u � v d ( u ) P ( u, v ) = 0 u ⇥� v adjacency matrix A P = D − 1 A � d ( u ) u = v D ( u, v ) = 0 u � = v
Random Walk on Graph random walk on G ( V , E ) • stationary: • convergence; • stationary distribution; • hitting time: time to reach a vertex; • cover time: time to reach all vertices; • mixing time: time to converge.
Random Walk on Graph � 1 u � v G ( V , E ) d ( u ) P ( u, v ) = 0 u ⇥� v • for finite chain: irreducible and aperiodic ⇒ converge • irreducible ⇔ G is connected P t ( u, v ) > 0 A t ( u, v ) > 0 • aperiodic ⇔ G is non-bipartite bipartite ⇒ no odd cycle ⇒ period =2 non-bipartite ⇒ ∃ (2k+1)-cycle � ⇒ aperiodic undirected ⇒ ∃ 2-cycle
Random Walk on Graph � 1 u � v G ( V , E ) d ( u ) P ( u, v ) = 0 u ⇥� v Stationary distribution π : π v = d ( v ) ∀ v ∈ V, 2 m d ( v ) 1 � � � d ( v ) = 1 π v = 2 m = 2 m v ∈ V v ∈ V v ∈ V d ( u ) d ( u ) = d ( v ) 1 � � ( π P ) v π u P ( u, v ) = = = π v 2 m 2 m u ∈ N ( v ) u ∈ V regular graph uniform distribution
Lazy Random Walk • undirected graph G ( V , E ) • lazy random walk: flip a coin to decide whether to stay 1 u = v 2 1 P ( u, v ) = u ∼ v 2 d ( u ) 0 otherwise adjacency matrix A P = 1 2( I + D − 1 A ) � d ( u ) u = v D ( u, v ) = 0 u � = v always aperiodic!
Lazy Random Walk 1 u = v 2 1 G ( V , E ) P ( u, v ) = u ∼ v 2 d ( u ) 0 otherwise Stationary distribution π : π v = d ( v ) ∀ v ∈ V, 2 m = 1 d ( v ) 2 m + 1 d ( u ) 1 � X ( π P ) v = π u P ( u, v ) 2 2 2 m d ( u ) u ∈ V u ∈ N ( v ) = d ( v ) = π v 2 m
Hitting and Covering consider a random walk on G ( V , E ) • hitting time: expected time to reach v from u ⇥ ⇤ ⌅ ⇧ ⇤ X n = v ⇤ � τ u,v = E min n > 0 ⇤ X 0 = u ⇤ • cover time: expected time to visit all vertices ⇥ ⇤ ⌅ ⇧ ⇤ { X 0 , . . . , X n } = V ⇤ � C u = E n ⇤ X 0 = u min ⇤ C ( G ) = max u ∈ V C u
G = K n C ( G ) = Θ ( n log n ) G : path or cycle C ( G ) = Θ ( n 2 ) G : “lollipop” K n 2 C ( G ) = Θ ( n 3 ) n 2
Hitting Time ⇥ ⇤ ⌅ ⇧ ⇤ X n = v ⇤ � τ u,v = E min n > 0 ⇤ X 0 = u ⇤ π v = d ( v ) stationary distribution π 2 m Renewal Theorem: τ v,v = 1 = 2 m d ( v ) π v
random walk on G ( V , E ) τ v,v = 1 = 2 m d ( v ) π v Lemma: τ u,v < 2 m uv ∈ E u 1 X τ v,v = d ( v )(1 + τ w,v ) v wv ∈ E X τ u,v < 2 m 2 m = (1 + τ w,v ) wv ∈ E
Cover Time � h i � { X 0 , . . . , X n } = V C ( G ) = max u ∈ V C u � � C u = E n � X 0 = u min � Theorem: C ( G ) ≤ 4 nm pick a spanning tree T of G
Cover Time � h i � { X 0 , . . . , X n } = V C ( G ) = max u ∈ V C u � � C u = E n � X 0 = u min � Theorem: C ( G ) ≤ 4 nm pick a spanning tree T of G Eulerian tour: v 1 → v 2 → · · · → v 2( n − 1) → v 2 n − 1 = v 1 2( n − 1) � C ( G ) ≤ τ v i ,v i +1 i =1 < 4 nm
USTCON ( undirected s - t connectivity ) • Instance: • undirected G ( V , E ) ; • vertices: s , t G undirected • s - t connected ? t s • deterministic: • traverse: linear space • log - space ?
Theorem ( Aleliunas - Karp - Lipton - Lovász - Racko ff 1979 ) USTCON can be solved by a poly - time Monte Carlo randomized algorithm with bounded one - sided error, which uses O ( log n ) extra space. unconnected ⇒ “no” • start a random walk at s ; • if reach t in steps 4 n 3 connected ⇒ return “yes” Cover time: • else return “no” C ( G ) ≤ 4 nm < 2 n 3 Markov’s inequality ⇒ space: O ( log n ) Pr [ “no” ] < 1/2
Electric Network edge uv : resistance R uv potential vertex v : φ v current flow edge orientation : C u → v u → v potential difference φ u,v = φ u − φ v Kirchhoff’s Law: ∀ vertex v , flow-in = flow-out ∀ edge uv , C u → v = φ u,v Ohm’s Law: R uv
Effective Resistance electrical network: 1 u 1 effective resistance R ( u , v ): potential difference between u and v required to send 1 unit of flow current from u to v
each edge e u resistance R e = 1 Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V,
graph G ( V , E ) construct an electrical network: for every edge e : R e = 1 each vertex u : inject d ( u ) units current flow into u a special vertex v : remove all 2 m units current flow from v Lemma: ∀ u ∈ V, φ u,v = τ u,v
Lemma: ∀ u ∈ V, φ u,v = τ u,v C u → w (Kirchhoff) X d ( u ) = uw ∈ E X (Ohm) φ u,w = uw ∈ E X = ( φ u,v − φ w,v ) uw ∈ E X = d ( u ) φ u,v − φ w,v uw ∈ E 1 X φ u,v = 1 + φ w,v d ( u ) uw ∈ E
Lemma: ∀ u ∈ V, φ u,v = τ u,v 1 X φ u,v = 1 + φ w,v d ( u ) uw ∈ E ⇥ ⇤ ⌅ ⇧ ⇤ X n = v ⇤ � τ u,v = E n > 0 ⇤ X 0 = u min ⇤ 1 X τ u,v = d ( u )(1 + τ w,v ) wu ∈ E 1 X = 1 + τ w,v d ( u ) wu ∈ E
Lemma: ∀ u ∈ V, φ u,v = τ u,v 1 X φ u,v = 1 + φ w,v d ( u ) ) uw ∈ E has the same unique solution 1 X = 1 + τ w,v τ u,v d ( u ) wu ∈ E
each edge e u resistance R e = 1 Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, A: B: Scenario B
Lemma: ∀ u ∈ V, φ u,v = τ u,v 1 X φ u,v = 1 + φ w,v d ( u ) ) uw ∈ E has the same unique solution 1 X = 1 + τ w,v τ u,v d ( u ) wu ∈ E
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, A: B: Scenario B φ A φ B v,u = τ v,u u,v = τ u,v
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, A: B: C: Scenario B Scenario C φ A φ C u,v = φ B φ B u,v = τ u,v v,u = τ v,u v,u = τ v,u D: D = A + C φ D u,v = φ A u,v + φ C u,v = τ u,v + τ v,u u,v : potential difference between u and v φ D to send 2 m units current flow from u to v Scenario D
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, A: B: C: Scenario B Scenario C φ A φ C u,v = φ B φ B u,v = τ u,v v,u = τ v,u v,u = τ v,u D: D = A + C φ D u,v = φ A u,v + φ C u,v = τ u,v + τ v,u R ( u, v ) = φ D u,v Scenario D 2 m
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, Theorem: C ( G ) ≤ 2 nm pick a spanning tree T of G Eulerian tour: v 1 → v 2 → · · · → v 2( n − 1) → v 2 n − 1 = v 1 2( n − 1) X � τ v i ,v i +1 = ( τ u,v + τ v,u ) C ( G ) ≤ i =1 uv ∈ T X ( R u,v + R v,u ) = 2 mn = 2 m uv ∈ T
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, u v G : path 1 n = O ( n 2 ) C ( G ) ≤ 2 nm = 2 n 2 C ( G ) = Θ ( n 2 ) = Ω ( n 2 ) C ( G ) ≥ τ u,v = τ v,u τ u,v + τ v,u = 2 mR ( u, v ) = 2 n ( n − 1)
Theorem (Chandra-Raghavan-Ruzzo-Smolensky-Tiwari 1989) τ u,v + τ v,u = 2 mR ( u, v ) ∀ u, v, ∈ V, G : lollipop u v K n 2 n 2 C ( G ) ≤ 2 nm = O ( n 3 ) C ( G ) = Θ ( n 3 ) = Ω ( n 3 ) C ( G ) ≥ τ u,v τ v,u = O ( n 2 ) τ u,v + τ v,u = 2 mR u,v = Ω ( n 3 )
Recommend
More recommend