{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lect notes-Introduction

lect notes-Introduction - Useful References 1 a Cormen...

Info iconThis preview shows pages 1–24. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 14
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 16
Background image of page 17

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 18
Background image of page 19

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 20
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Useful References 1 a Cormen, Leiserson, Rivest & Stein :1 T.C. Hu and MT. Shing Enlarged Second Edition, Dover paperback :1 Cook, Cunningham, Pulleyblank, SchrUver m Korte & Vygen a Kleinberg & Tardos 0 r1, 042/ CSE 202, April 6, 2006 - 1 / 11 Useful References 2 :1 Graphs, Networks & Algorithms by Dieter Jungnickel a Combinatorial Optimization by Alexander Schrijver Vol A, B, C Pages 1 — 1882 0-3 0,3 CSE 202, April 6, 2006 — 2 / 11 BFS '(G,s) 1 2 3 10 11 12 13 14 15 16 17 18 for each vertex u e V [G] — {3} do color[u] é— WHITE d[u] <— co 1t[u] e— NIL color[s] <— ‘GRAY d[s] <— 0 1c[s] <— NIL Q <— {8} While Q 4i (1) do u <—' head [Q] for each 12 E Adj[u] doifcolor [v] = WHITE then color[v] (— GRAY d[v]<—— d[u] + 1 1c[v] <— u ENQUEUE (Q, v) DEQUEUE (Q) color[u] <— BLACK DFS (G) 1 for each vertex u E V [G] do color[u] <— WHITE 7r,[u] (— NIL time <— 0 for each vertex u E V [G] do if color[u] = WHITE then DPS-Visit (u) DPS—Visit (u) 8 eolor[u] <— GRAY t> White vertex it has just been discovered. d[u]<— time <— time +1 for each v e Adj[u] l> Explore edge (u,v).‘ do if color[v] = WHITE then 1t[v] <— u_ DPS-Visit (v) color[u] <— BLACK D Blacken u; it is finished. f[u] (— time <— time + 1 f‘xJ Traversing Graphs Visiting all nodes 0f G in some order TWO nodes are neighbors if they share an edge Edge 8/. Arc o edge . Node A and Node B are neighbors 0 arc e A is not a neighbor of B B is a neighbor of A Mi CSE 202, April 6, 2006 - 3 / 11 BFS Let 1, 2, ...i, ...,j, ..., k be the assigned labels _ & Vi has the smallest label and unlabeled neighbors. Label the neighbor K+1 BFS 0. Label a vertex V1. I={1} 1. Index I = {1, 2, ..., k} x be a neighbor of the smallest index vertex 2. Label x with k+l Return to step 1 DFS Let 1, 2, ..., i, ...,j, ..., k be the assigned labels & Vj has the largest label and unlabeled neighbors Label the neighbor K+1 ‘ / DFS C7“? Step 0. Same Step 1. Smallest 6— largest- . . Step 2. Same BFS DFS Shortest Path (Dijkstra) Minimum Spanning Tree (Prim) . Shortest Paths Floyd& Warshall 01 | path I 2 | subpath | 02 Subpath of shortest path must itself be shortest 03 Any shortest path contains at most n-1 arcs P13 P23 P33...SPH_1 Shortest Paths (Dijkstra) 0. Vertex V0 with t5”: 0 Vi get temp labels 6 i = doi (direct are) 61' = °° (if no direct are) 1. Pick BK: min Ei ' EKF£K>k 2. 21 am [61,?“ am] Shortest Path Minimum Spanning Tree (Prim) 0. Same 1. Same 2. 6i <_ min [€i, dKi] In general £1 6 min m, a€K*+BdKi] H3 4'19 2 5 302° Hi Shortest Paths From 0 To All W CSE 202, April 6, 2006 - 9 / 11 ‘ Minimum Spanning Tree CSE 202, April 6, 2006 — 10 / 11 Minimum Clock Tree than 9 o e 9 o 0913 [,2L CSE 202, April 6, 2006 - 11 / 11 Other Opt. Paths L (e1, e2: 63! "'J en) : L (L (91, 92, 63, ... s en-1)! en) L (91, 625 93, ”-5 en! en+1) 2 L (91, 92, es, .. ., en) ...
View Full Document

{[ snackBarMessage ]}