CSC263H1 Lecture 17: Lecture 17.docx

47 views3 pages

Document Summary

[v] = length of shortest path s v. Lemma 0: after bfs(s), v: (s,v) d[v] Theorem: after bfs(s), v: (s,v) = d[v] Lemma 1: if u enters the q before v, then d[u] g[v] After bfs(g,s) , nodes v of g, d[v] = (s,v) G and a node s of g after bfs(g,s), node x of g s. t. d[x] =/= (s,x) Let v e the closest node from s such that d[v] =/= (s,v) clearly (s,v) < d[v] (s,v) = (s,u) + 1 since u is closer than v to s, then by definition of v, (s,v) = d[u] d[v] > (s,v) = (s,u) + 1 = d[u] + 1 d[v] > d[u] + 1 * Consider the colour of v just before the bf explores node u. 3 possible cases: v is white so u discovers v so d[v] = d[u] + 1 a contra to , v is black v explored before u v enters q before u.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents