Directed Graphs (Digraphs) Because not all edges are equal Jordan Bush

advertisement
Directed Graphs (Digraphs)
Because not all edges are equal
Jordan Bush
March 30, 2016
CS 594: Graph Theory
Table of contents
1. Introduction
2. Definitions and Properties
3. Digraph Connectivity
4. Directed Trees
5. Open Problems
2
Introduction
Graphs are used to represent pairwise relationships
between objects. So far we have discussed undirected
graphs, where the relationships are mutual.
But what happens when we model connections where
the players have different types of relationships?
4
Non-Symetric Relationships in Daily Life
5
Philosophical Origin of Directed Graphs
Some people speculate that Aristotle verbally outlined the first
directed graph as a way to organize logical arguments1 .
6
Philisophical Origin of Directed Graphs
Similarly, Agustus De
Morgan created a logic
structure in his Theory of
Relations (1847) that
functions as an algebraic
directed graph1 .
De Morgan’s Logic2
(a) If A ∧ B → ¬C
(b) If A ∧ ¬C → ¬B
(c) If ¬C ∧ B → ¬A
7
Mathematical Origin of Directed Graphs
In the beginning, mathematicians mostly focused on undirected
graph problems3 .
8
Mathematical Origin of Directed Graphs
In 1845, Gustav Robert Kirchhoff
developed a mathematical
formula for calculating current
flow around a circuit by
visualizing it as a directed graph.4
9
Mathematical Origin of Directed Graphs
French mathematician Henry
Poincare later expanded upon
these ideas to form the field of
topology (1895)4 .
By 1936, directed graphs had
become so well-developed that
the first textbook on graph theory
included an entire chapter on
them (Konig 1936)3,5 .
10
Definitions and Properties
Basic Definitions6
A directed graph (aka digraph) D is a pair (V, A), where V is a
nonempty set of elements are called vertices and A is a collection of
ordered pairs of elements of V, called arcs.
We call a digraph with no loops or multiple arcs a simple digraph.
12
Basic Definitions7
We denote arc a = (u, v), where the arc points from node
u to node v, as uv
If both uv and vu are in A, we say uv, vu are symmetric
pairs of arcs
13
Basic Definitions6
In directed graphs, we distinguish between the number of edges
coming in (indegree, denoted d− ) and the number going out
(outdegree, denoted d+ ).
The total degree of a vertex is d(v) = d− (v) + d+ (v)
14
Basic Definitions6
An oriented graph is a directed graph with no symmetric
pairs of arcs. A tournament is a complete oriented graph.
Figure 1: Non-oriented graph
Figure 2: Oriented graph
15
Notation7
An arc sequence in a digraph D is an alternating
sequence of vertices and arcs of D.
v1 a1 v2 a2 ...ak−1 vk
For simple digraphs (i.e., no multiple edges), an arc
sequence can be written using only vertices
v1 v2 ...vk
16
Relationship between Directed and Undirected Graphs7
All directed graphs have a unique underlying undirected graph
associated with them
Let D = (V, A) be a digraph. We call the graph G = (V, E) the underlying
graph of D when uv ∈ E if and only if uv or vu (or both) are in A.
Figure 3: Directed graph, D
Figure 4: Underlying graph of D
17
Relationship between Directed and Undirected Graphs7
There are two ways to convert an undirected graph into a
(non-unique) directed graph.
1. Given undirected graph G = (V, E), the digraph with vertex set V
and a symmetric uv whenever uv ∈ E, is called the digraph
corresponding to G
2. An oriented graph obtained from the graph G = (V, E) by
replacing each edge uv ∈ E by an arc uv or vu, but not both is
called an orientation of G
18
Digraph Connectivity
Strong vs Weak Connectivity7
A digraph D = (V, A) is strongly connected if for every distinct
vertices u, v ∈ V, there is a path from u to v.
A digraph is weakly connected if for every distinct vertices u, v ∈ V,
there is a path from u to v in the underlying (undirected) graph of D.
Figure 5: Strongly connected
Figure 6: Weakly connected
20
Theorem 1: A digraph is strongly connected if and only if it has a
spanning closed arc sequence7 .
21
Theorem 1: A digraph is strongly connected if and only if it has a
spanning closed arc sequence7 .
Proof: (⇒) Let D = (V, A) be a strongly connected digraph with
V = v1 , v2 , ..., vn . Then there is an arc sequence from each vertex in V
to every other vertex in V.
21
Theorem 1: A digraph is strongly connected if and only if it has a
spanning closed arc sequence.
Proof: (⇐) Assume that D has a spanning closed arc sequence. Pick
u, v ∈ V.
Spanning closed arc sequence of D:
22
Theorem 1: A digraph is strong if and only if it has a spanning closed
arc sequence.
Proof: (⇐) Assume that D has a spanning closed arc sequence. Pick
u, v ∈ V.
If u comes before v in arc sequence:
23
Theorem 1: A digraph is strong if and only if it has a spanning closed
arc sequence.
Proof: (⇐) Assume that D has a spanning closed arc sequence. Pick
u, v ∈ V.
If v comes before u in arc sequence:
24
Theorem 1: A digraph is strongly connected if and only if it has a
spanning closed arc sequence.
Proof: (⇒) Let D = (V, A) be a strong digraph with V = v1 , v2 , ..., vn . Then
there is an arc sequence from each vertex in V to every other vertex in V.
Therefore, there exists arc sequences Q1 , Q2 , ..., Qn1 such that the first vertex
of Qi is vi and the last vertex of Qi is vi+1 , for i = 1, 2, ..., n−1. Also, there exists
an arc sequence, say Qn , with first vertex vn and the last vertex v1 . Then the
arc sequence obtained by traversing the arc sequences Q1 , Q2 , ..., Qn in
succession is a spanning closed arc sequence of D.
(⇐) Let u and v be two distinct vertices of V. If v follows u in any spanning
closed arc sequence, say Q of D, then there exists a sequence of the arcs of
Q forming an arc sequence from u to v. If u follows v in Q, then there is an
arc sequence from u to the last vertex of Q and an arc sequence from that
vertex to v. An arc sequence from u to v is then obtained by traversing these
two arc sequences in succession.7
25
Directed Eulerian Walks
A directed path is an open walk in which no vertex is repeated.
A Eulerian path is a closed walk which traverses every arc of a
digraph exactly once.
26
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is
connected and for each of its vertices v, d− (v) = d+ (v).7
27
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is
connected and for each of its vertices v, d− (v) = d+ (v).7
Proof: (⇒) Let D be an Eulerian digraph with Eulerian walk W.
27
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is
connected and for each of its vertices v, d− (v) = d+ (v).
Proof:(⇐) Suppose for every vertex v ∈ D, d− (v) = d+ (v).
28
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is
connected and for each of its vertices v, d− (v) = d+ (v).
Proof:(⇐) Suppose for every vertex v ∈ D, d− (v) = d+ (v).
28
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is
connected and for each of its vertices v, d− (v) = d+ (v).
Proof:(⇐) Suppose for every vertex v ∈ D, d− (v) = d+ (v).
28
How do we know if a digraph is Eularian?
Theorem 2: A digraph D = (V, A) is Eulerian if and only if D is connected and
for each of its vertices v, d− (v) = d+ (v).
Proof: (⇒) Let D be an Eulerian digraph with Eulerian walk W. In traversing W, every
time a vertex v is encountered we pass along an arc incident towards v and then an
arc incident away from v. This is true for all the vertices of W, including the initial
vertex of W (where we begin and end)
(⇐) Suppose for every vertex v ∈ D, d− (v) = d+ (v). For any v in D, we identify a walk,
starting at v and traversing each arc of D at most once. This is continued until it is
impossible to traverse further. Since every vertex has the same number of arcs
pointing into it as away from it, we can leave any vertex that we enter along the walk,
therefore the walk will stop at v. Let the walk so far be denoted by W. If W = A, then D
is Eularian. If not, remove from D all the arcs of W and consider the remainder of A. By
the original assumption, each vertex in the remaining digraph, say D1, is such that
d− (v) = d+ (v). Also, W and D1 have a vertex in common, since D is connected.
Starting at this vertex, repeat the above process. Each time the process is repeated, it
will yield another directed cycle that traverses a subset of the graph without using any
arcs from a previously derived cycle. Because the indegree equals the outdegree of all
vertices in D, every vertex will eventually be covered through the above process, and
the sum of all the walks found will be a Eulerian cycle.7
29
Fun Application: Google Search Algorithm
Original search engines organized
their results based on how often
each site used the inputted
search terms
Google’s innovation was to
organize websites by order of
”importance”, using centrality
metrics from graph theory
30
Fun Application: Google Search Algorithm
31
Fun Application: Google Search Algorithm
32
Fun Application: Google Search Algorithm8
Pick α ∈ (0, 1) and let e be a n × 1 vector (1 1 . . . 1)T . We then define
the Google matrix Gα as
( )
1
Gα = αA + (1 − α)
eeT
n
which expands to

a11 a12

a
 21 a22
Gα = α 
..
 ..
.
 .
an1
an2
...
...
a1n
a2n
..
.
. . . ann






 + (1 − α) 




1/n 1/n . . .
1/n 1/n . . .
..
..
.
.
1/n 1/n . . .
1/n
1/n
..
.



.


1/n
33
Directed Trees
Trees7
Undirected Tree An undirected graph with no cycles
Directed Acyclic Graph (DAG) A digraph with no directed cycles
Directed Tree A digraph with no directed cycles and no semi-cycles
Figure 7: Undir. Tree
Figure 8: DAG
Figure 9: Directed Tree
35
Arborescences7
A directed tree is called an arborescence if it contains exactly one
vertex, called the root, with no arcs directed towards it and all other
arcs directed away from it.
36
How do we know if a DAG is an arborescence?
Theorem 3: A DAG is an arborescence if there is a vertex v in D such
that every other vertex is reachable from v and v is not reachable
from any other vertex.
Proof: Let D = (V, A) be a DAG that contains a vertex v such that
every vertex in D is reachable from v and v is not reachable from any
other vertex, (d− (v) = 0). Consider vertex u where u ∈ V, u ̸= v. Since
every other vertex is reachable from v, the indegree of u must be
greater than or equal to 1. However, there are n vertices and n − 1
arcs, therefore u must have indegree less than or equal to 1. So for
every , deg− (u) ≥ 1 and deg− (u) ≤ 1, therefore deg− (u) = 1.
Therefore all nodes other than the root have an indegree of 1, so D is
an arboresence7 .
37
Properties of an Arborescence
Theorem 4: In an arborescence, there is a directed path from the
root v to every other vertex.
Proof: In an arborescence, consider a directed path P starting from
the root v and continuing as far as possible. Clearly, P can end only
at a pendant vertex, since otherwise, we get a vertex whose indegree
is two or more, which is a contradiction. Since an arborescence is
connected, every vertex lies on some directed path from the root v
to each of the pendant vertices7 .
38
Fun Applications: Food Webs
Food webs show feeding
relationships between organisms
(arrow points in direction of
energy flow, i.e. towards
consumer). They can be modeled
as directed acyclic graphs, as
energy never flows down a tropic
level.
39
Open Problems
Open Problems9
• Caccetta-Häggkvist Conjecture: Every simple digraph of order n
with minimum outdegree at least r has a cycle with length at
most ⌈n/r⌉
41
Open Problems9
• Caccetta-Häggkvist Conjecture: Every simple digraph of order n
with minimum outdegree at least r has a cycle with length at
most ⌈n/r⌉
• Hoàng-Reed Conjecture Every digraph in which each vertex has
outdegree at least k contains k directed cycles C1 , . . . , Ck such
j−1
that Cj meets ∪i=1
Ci in at most one vertex, 2 ≤ j ≤ k. (would
imply C-H conjecture).
41
Open Problems9
• Caccetta-Häggkvist Conjecture: Every simple digraph of order n
with minimum outdegree at least r has a cycle with length at
most ⌈n/r⌉
• Hoàng-Reed Conjecture Every digraph in which each vertex has
outdegree at least k contains k directed cycles C1 , . . . , Ck such
j−1
that Cj meets ∪i=1
Ci in at most one vertex, 2 ≤ j ≤ k. (would
imply C-H conjecture).
• Does every edge-colored tournament have either a rainbow
directed cycle or a vertex v so that every other vertex can be
reached from v by a monochromatic path?
41
Homework Problems
1. Determine if the following two graphs are strongly connected,
weakly connected, or neither. If the graph is strongly connected,
does it have a Eulerian path?
42
Homework Problems
2. Prove that every Eulerian digraph is strongly connected. Is the
converse true? (i.e., is every strongly connected graph Eulerian?)
3. Use the theorem below to prove that if D is a strong digraph
such that for any vertex v, d(v) = d+ (v) + d− (v) ≥ n, then D is
Hamiltonian.
Theorem If D is a strong digraph of order n such that for any
pair of non-adjacent vertices u and v, d(u) + d(v) ≥ 2n − 1, then
D is Hamiltonian.
43
Questions?
44
References I
1. Black, Paul. 2008. ”directed graph”, in Dictionary of Algorithms
and Data Structures [online], Vreda Pieterse and Paul E. Black,
eds.
2. Whelden, Roy. 2000. The Origins and Use of the Theory of
Relations: Peirce, DeMorgan and Music Analysis. Transactions of
the Charles S. Peirce Society 36(1):49-73
3. https://en.wikipedia.org/wiki/Graph_theory#
cite_note-12
4. Barnett, Janet H. 2009. Early Writings on Graph Theory:
Topological Connections . In Resources for Teaching Discrete
Mathematics: Classroom Projects, History Modules, and Articles,
ed. Brian Hopiks. Mathematical Association of America. Pg
231-240.
45
References II
5. König, Dénes. 1936. Theory of finite and infinite graphs.
Birkhäuser.
6. http://mathworld.wolfram.com/DirectedGraph.html
7. Chapter 11: Digraphs. (mysterious yet magical book chapter)
http://compalg.inf.elte.hu/~tony/Oktatas/TDK/
FINAL/Chap%2011.pdf
8. Page, L. S. Brin, and T. Winograd. 1999. The Pagerank citation
ranking: Bringing order to the web. Technical Report 1999-66.
Standford InfoLab.
46
Download