Directed Graphs the same

advertisement
Mathematics for Computer Science
MIT 6.042J/18.062J
Digraphs
• a set, V, of vertices
• a set, E ⊆ V×V
of directed edges
(v,w) ∈ E notation: v→w
Directed Graphs
v
Albert R Meyer, March 1, 2010
lec 5M.1
Relations and Graphs
a
d
Albert R Meyer, March 1, 2010
lec 5M.2
Digraphs
b
Formally, a digraph
with vertices V is
the same as a binary
relation on V.
c
V= {a,b,c,d}
E = {(a,b), (a,c), (c,b)}
Albert R Meyer, March 1, 2010
w
lec 5M.3
Albert R Meyer, March 1, 2010
lec 5M.4
1
Graphical Properties of Relations
Reflexive
Graph of Strict Partial Order
a
Asymmetric
NO
Transitive
d
Symmetric
e
Albert R Meyer, March 1, 2010
lec 5M.6
Graph of Strict Partial Order
f
Albert R Meyer, March 1, 2010
lec 5M.15
Cycles
how to check?
•  no self-loops i→i ∉ E
(irreflexive)
•  if edges i→j and j→k
then shortcut edge i→k is
there too
(transitive)
Albert R Meyer, March 1, 2010
c
b
A cycle is a positive length
directed path that starts and
ends at the same vertex.
simple cycle: each vertex only
once, except start = end
lec 5M.16
Albert R Meyer, March 1, 2010
lec 5M.17
2
Graph of Strict Partial Order
Directed Cycle
v0
v1
v2
…
vn-1
by asymmetry: if there is a
path from a to b, then there is
v0
none from b to a
graph has no cycle
vi
vi+1
v0
a directed acyclic graph
DAG
Albert R Meyer, March 1, 2010
Graph of Strict Partial Order
lec 5M.19
Strict P.O. from a DAG
but from any DAG, get a strict
p.o. by adding “transitive” edges:
strict p.o. implies DAG, but
not every DAG is strict p.o.
if there is a path in the DAG,
add an edge from start to end:
not transitive
d
a
also need
these edges
Albert R Meyer, March 1, 2010
Albert R Meyer, March 1, 2010
lec 5M.18
b
lec 5M.20
c
Albert R Meyer, March 1, 2010
lec 5M.21
3
Positive Path Relation
DAG's & Partial Orders
relation R on a set V
Theorem:
• The graph of a strict partial
order is a DAG.
• The positive path relation of a
DAG is a strict partial order.
aR+b iff
there is a nonzero directed
path from a to b
aRv1Rv2RRb
Albert R Meyer, March 1, 2010
Albert R Meyer, March 1, 2010
lec 5M.22
Covering Edges
Graph of Strict Partial Order
a
c
b
a
what is smallest
DAG whose paths
define this
partial order?
unneeded edges
covering edges
c
b
d
e
e.g. any path
from c to d must
traverse c→d
d
e
f
Albert R Meyer, March 1, 2010
lec 5M.23
lec 5M.24
f
Albert R Meyer, March 1, 2010
lec 5M.25
4
Problems
1-3
Albert R Meyer, March 1, 2010
lec 5M.26
5
MIT OpenCourseWare
http://ocw.mit.edu
6.042J / 18.062J Mathematics for Computer Science
Spring 2010
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Download