Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 18 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
18
Dung lượng
222,5 KB
Nội dung
Directed Graphs 3/6/12 Normal Person’s Graph y = f(x) y x 3/6/12 Computer Scientist’s Graph a b c d f e 3/6/12 Digraphs • a set, V, of vertices aka nodes a set, E VìV of directed edges (v,w) ∈ E notation: v→w v 3/6/12 w Relations and Graphs a b d c V= {a,b,c,d} E = {(a,b), (a,c), (c,b)} 3/6/12 Digraphs Formally, a digraph with vertices V is the same as a binary relation on V 3/6/12 Walks & Paths Walk: follow successive edges length: edges (not the vertices) 3/6/12 Walks & Paths Path: walk thru vertices without repeat vertex length: edges 3/6/12 Walks & Paths Lemma: The shortest walk between two vertices is a path! Proof: (by contradiction) suppose path from u to v crossed itself: c u 3/6/12 v Walks & Paths Lemma: The shortest walk between two vertices is a path! Proof: (by contradiction) path from u to v then path without c -csuppose is crossed itself: shorter! c u 3/6/12 v 10 Walks & Paths Digraph G defines walk + relation G u G + v iff ∃walk u to v (the positive walk relation) “+” means or more 3/6/12 11 Walks & Paths Digraph G defines walk * relation G * u G v iff ∃ walk 123 u to v length ≥0 (the walk relation) “*” means “0 or more” 3/6/12 12 Cycles A cycle is a walk whose only repeat vertex is its start & end (a single vertex is a length cycle) 3/6/12 13 Cycles … v0 v1 v2 vn-1 v0 vi v0 3/6/12 vi+1 14 Closed Walks & Cycles Closed walk starts & ends at the same vertex Lemma: The shortest positive length closed walk containing a vertex is a positive length cycle! Proof: similar 3/6/12 15 Directed Acyclic Graph DAG has no positive length cycle 3/6/12 16 lec 7M.16 Directed Acyclic Graph examples: DAG < relation on integers ⊊ relation on sets prerequisite on classes 3/6/12 17 Example: Tournament Graph • Every team plays every other H H Y Y P P D D DAG => Unique ranking 3/6/12 18 ...Normal Person’s Graph y = f(x) y x 3/6/12 Computer Scientist’s Graph a b c d f e 3/6/12 Digraphs • a set, V, of vertices aka “nodes” • a set, E ⊆ V×V of directed... notation: v→w v 3/6/12 w Relations and Graphs a b d c V= {a,b,c,d} E = {(a,b), (a,c), (c,b)} 3/6/12 Digraphs Formally, a digraph with vertices V is the same as a binary relation on V 3/6/12 Walks & Paths