Download presentation
Presentation is loading. Please wait.
2
233-234233-234 Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)
3
Adjacency lists
4
1. Birds eat the bread crumbs 2. They don’t random walk DFS/BFS Hansel & Gretel
6
Diffusion equation
7
Normal distribution Random walk
9
With bread crumbs one can find exit in time proportional to V+E DFS/BFS Hansel & Gretel
10
Breadth First Search
16
F A BCG DE H
17
F A BCG DE H Queue: A get 0 distance from A visit(A)
18
Breadth First Search F A BCG DE H Queue: 0 F 1 F discovered
19
Breadth First Search F A BCG DE H Queue: F 0 1 B 1 B discovered
20
Breadth First Search F A BCG DE H Queue: F B 0 1 1 C 1 C discovered
21
Breadth First Search F A BCG DE H Queue: F B C 0 1 1 1 G 1 G discovered
22
Breadth First Search F A BCG DE H Queue: F B C G get 0 1 1 1 1 A finished
23
Breadth First Search F A BCG DE H Queue: B C G 0 1 1 1 1 A already visited
24
Breadth First Search F A BCG DE H Queue: B C G 0 1 1 1 1 D 2 D discovered
25
Breadth First Search F A BCG DE H Queue: B C G D 0 1 1 1 1 2 E 2 E discovered
26
Breadth First Search F A BCG DE H Queue: B C G D E get 0 1 1 1 1 2 2 F finished
27
Breadth First Search F A BCG DE H Queue: C G D E 0 1 1 1 1 2 2
28
Breadth First Search F A BCG DE H Queue: C G D E 0 1 1 1 1 2 2 A already visited
29
Breadth First Search F A BCG DE H Queue: C G D E get 0 1 1 1 1 2 2 B finished
30
Breadth First Search F A BCG DE H Queue: G D E 0 1 1 1 1 2 2 A already visited
31
Breadth First Search F A BCG DE H Queue: G D E get 0 1 1 1 1 2 2 C finished
32
Breadth First Search F A BCG DE H Queue: D E 0 1 1 1 1 2 2 A already visited
33
Breadth First Search F A BCG DE H Queue: D E 0 1 1 1 1 2 2 E already visited
34
Breadth First Search F A BCG DE H Queue: D E get 0 1 1 1 1 2 2 G finished
35
Breadth First Search F A BCG DE H Queue: E 0 1 1 1 1 2 2 E already visited
36
Breadth First Search F A BCG DE H Queue: E 0 1 1 1 1 2 2 F already visited
37
Breadth First Search F A BCG DE H Queue: E get 0 1 1 1 1 2 2 D finished
38
Breadth First Search F A BCG DE H Queue: 0 1 1 1 1 2 2 D already visited
39
Breadth First Search F A BCG DE H Queue: 0 1 1 1 1 2 2 F already visited
40
Breadth First Search F A BCG DE H Queue: 0 1 1 1 1 2 2 G already visited
41
Breadth First Search F A BCG DE H Queue: 0 1 1 1 1 2 2 H 3 H discovered
42
Breadth First Search F A BCG DE Queue: H get 0 1 1 1 1 2 2 H 3 E finished
43
Breadth First Search F A BCG DE H Queue: 0 1 1 1 1 2 2 3 E already visited
44
Breadth First Search F A BCG DE H Queue: STOP 0 1 1 1 1 2 2 3 H finished
45
Breadth First Search F A BCG DE H 0 1 1 1 1 2 2 3 distance from A
46
Breadth-First Search
47
b c a d a c d b v
51
Rod Steiger Martin Sheen Donald Pleasence #1 #2 #3 #876 Kevin Bacon Barabasi
52
Why Kevin Bacon? Measure the average distance between Kevin Bacon and all other actors. 876 Kevin Bacon 2.786981 46 1811 Barabasi
54
Langston et al., A combinatorial approach to the analysis of differential gene expression data…. Minimum Dominating Set
57
size of dominating set
58
Expected size of dominating set Assume each node has at least d neighbors Naïve algorithm still n/2 in worst case Simple probabilistic algorithm:
59
1. For each vertex v, color v red with probability p
60
2. Color blue any non-dominated vertex
61
X= number of red nodes Y= number of blue nodes Size of dominating set = X+Y
66
Expected size of dominating set S =
67
Markov’s inequality proof j= k E|S|
68
Probability that is < 1/2 Run algorithm 10 times and keep smallest S with probability > 0.999
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.