Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Section 3.5 Directed Graphs 1
Section Section Section Section 3333....5555 Di Di Di Directed Graphs : Tournament Graphsrected Graphs : Tournament Graphsrected Graphs : Tournament Graphsrected Graphs : Tournament Graphs
Purpose of Section: Purpose of Section: Purpose of Section: Purpose of Section: We introduce the directed graphdirected graphdirected graphdirected graph and its adjacency matrix,
and then show how directed graphs arise in connection with tournaments of
various types.
IntroductionIntroductionIntroductionIntroduction
Thus far in our in our discussions of graphs we have not associated a
“direction” with the edges of the graph. In the Konigsberg Bridge Problem,
we were allowed to traverse each edge in either direction. In many problems,
however, such as traffic problems with one-way streets, we must restrict the
direction of movement along the edges to only one direction. A directed graphdirected graphdirected graphdirected graph
(or digraphdigraphdigraphdigraph) is defined similarly to a (undirected) graph, except that the edges
of the graph are “directed” from one vertex to another. We call these types
of edges directed edgesdirected edgesdirected edgesdirected edges (sometimes called arcsarcsarcsarcs). If the directed edge goes
from vertex u to vertex v , then u is called the headheadheadhead (or sourcesourcesourcesource) and v is
called the tail tail tail tail (or sinksinksinksink) of the edge, and v is said to be the direct successor direct successor direct successor direct successor of
u and u is the direct predecessordirect predecessordirect predecessordirect predecessor of v . See Figure 1
A directed graph with directed edges joining the vertices
Figure 1
The applications of directed graphs range from transportation problems
in which traffic flow is restricted to one direction, one-way communication
problems, asymmetric social interactions, athletic tournaments, and even the
World-Wide Web. Before talking about applications, however, we introduce
the concept of the adjacency matrix of a directed graph.
Section 3.5 Directed Graphs 2
Definition Definition Definition Definition The adjacency matrixadjacency matrixadjacency matrixadjacency matrix of a directed graph having n vertices is an
n n× matrix ( )ijM m= where
1 if there is a directed edge from node to node
0 if there is not a directed edge from node to node ij
i jm
i j
=
For example, the adjacency matrix for the digraph in Figure 2 is
0 0 1 1 0
1 0 1 1 0
0 0 0 0 0
0 0 1 0 1
1 1 1 0 0
M
=
Tournament Graphs (Dominance Graphs)Tournament Graphs (Dominance Graphs)Tournament Graphs (Dominance Graphs)Tournament Graphs (Dominance Graphs)
A tournament graphtournament graphtournament graphtournament graph (or dominant graphdominant graphdominant graphdominant graph) is a directed graph where every
pair of vertices is joined by exactly one directed edge. In other words, for
each pair of vertices u and v in a tournament graph, there is a directed edge
from to u v or from to v u , but not both. Figure 2 shows a tournament graph
with five vertices.
Tournament Graph with Five Vertices
Figure 2
Tournament graphs are aptly named since they often are applied to
tournaments of some kind. They are the familiar round-robin tournaments in
Section 3.5 Directed Graphs 3
tennis, baseball, and so on where every team plays every other team exactly
once (and we assume no ties).
The number of directed edges “leaving” a vertex u is called the outoutoutout----
degreedegreedegreedegree of the vertex and denoted by ( )od u . In the directed graph in Figure 2
we have ( ) ( )od 5 3,od 1 2= = . If the vertices of the graph are athletic teams,
and a directed edge from vertex u to vertex v means team beats team u v ,
then the out-degree of u is the number of wins for the team u . On the other
hand, the number directed edges “entering” a vertex v is called inininin----degreedegreedegreedegree of
v and denoted by ( )id v . In Figure 2 we have ( ) ( )id 5 1, id 1 2= = . In connection
with athletic tournaments, it is the number of losses for team v .
Tournament graphs are even used by sociologists, who call them
dominance graphs, used in the study of social interactions.
Dominance Graphs in SociologyDominance Graphs in SociologyDominance Graphs in SociologyDominance Graphs in Sociology
Many social situations involve people or groups of people (countries,
cultures, universities, and so on) in which some individuals or group
“dominates” others. The word “dominate” can refer to many kinds of
dominance: cultural, physical, political, economic, and so on.
Suppose a sociologist wishes to study dominance patterns in a close-knit
group of college students. The group consists of five woman: Amy (A), Betty
(B), Carol (C), Denise (D), and Elaine (E). The sociologist begins by
conducting interviews with each pair of students to determine the pair wise
dominance1 of the students. If person A dominates person B, we denote this
by writing A B→ . (We assume that for each pair of students, one person
dominates the other.) After conducting the interviews, the sociologist draws
the dominance graph that represents pair wise dominations of the entire
group, which is shown in Figure 3. Note that Amy dominates Betty and that
Denise dominates Carol.
1 The determination of one-on-one dominance can be carried out by a series of questions, although it can be
subjective in some instances.
Section 3.5 Directed Graphs 4
Dominance Graph for Amy, Betty, Carol, Denise, and Elaine
Figure 3
The adjacency matrix for the dominance graph is
0 1 1 0 1
0 0 0 0 0
0 1 0 0 1
1 1 1 0 0
0 1 0 1 0
A B C D E
A
B
M C
D
E
=
The number of 1’s in each row is the out-degree of the row vertex and
represents the number of firstfirstfirstfirst----stage stage stage stage dominancesdominancesdominancesdominances of that individual. Note that
vertices and A D each have a “score” of 3, vertices and C E each have a
score of 2, and B has a score of 0. In other words, Amy dominates three
people in first stage dominances (Betty, Carol, and Elaine), whereas Carol
dominates two people in the first stage (Betty and Elaine), and Betty
dominates no one.
The goal is to find the group leadergroup leadergroup leadergroup leader2222. If one person dominates every
person in the group, then obviously we would call that person the group
leader. If no one person dominates every other person, then the person with
the most first-stage dominances is declared group leader. If two or more
people tie with the most first-stage dominances, then we must resort to
ssssecondecondecondecond----stage stage stage stage dominancesdominancesdominancesdominances. In our example, Amy and Denise are tied, each
with 3 first-stage dominances.
2 If these were athletic teams playing in a conference round-robin tournament, we would want to know who
should be declared the conference winner.
Section 3.5 Directed Graphs 5
To understand second-stage dominances, note that Elaine dominates
Denise and Denise dominates Amy. Hence, we say that Elaine has a second-
stage dominance (or second-stage influence) over Amy and we denote this by
E D A→ → . To find the number of second-stage dominances, consider the
square of the adjacency matrix 2M , which is
2
0 2 0 1 1
0 0 0 0 0
0 1 0 1 0
0 2 1 0 2
1 1 1 0 0
A B C D E
A
B
M C
D
E
=
To understand the meaning of 2M (See Problem 15), observe in the dominance
graph in Figure 3 that A dominates E and E dominates D , which we write as
A E D→ → , which is the only second-stage dominance of A over D . This
fact is indicated by the 1 in row A , column D of 2M . Also note that A has
two second-stage dominances over B ( A C B→ → and A E B→ → ), which is
indicated by a 2 in row A , column B of 2M . By examining 2M we see that
Denise has a total of five second-state dominances compared to four second-
state dominances for Amy. Thus, we declare Denise the group leader.3
We could continue our analysis of group dominance by computing the
sum 2M M+ , whose elements give the total number of first-stage and
second-stage dominances of one person over another.
2
2
0 1 1 0 1 0 2 0 1 1 0 3 1 1 2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 1 0 1 0 1 0 0 2 0 1 1
1 1 1 0 0 0 2 1 0 2 1 3 2 0 2
0 1 0 1 0 1 1 1 0 0 1 2 1 1 0
A B C D E A B C D E A B C D E
A A A
B B B
M M C C C
D D D
E E E
M M
+ = + =
+
3 Since Amy and Denise both have at least three second-stage dominances, we could compute ( )3
M G ,
which would give the number of third-stage dominances. One suspects, however, that although we might
define third-order dominances in theory, it is difficult to observe them in reality.
Section 3.5 Directed Graphs 6
For example, Amy ( )A has 3 first- and second-stage dominances over Betty
( )B . The sum of the entries in row A represent the total number of ways
Amy dominates some person in the group in the first two stages. Here, Amy
has 7 first- and second-stage dominances over the members in the group.
(Can you find them?) However, Denise has a total of 8 first- and second-
stage dominances, so we would call Denise the leader of the group.
Tournament graphs also arise in conjunction with paired comparison paired comparison paired comparison paired comparison
experimentsexperimentsexperimentsexperiments in consumer testing, where a subject is given pairs of alternatives
and asked to determine which is preferable.
Paired Comparison Experiments (Cycles in Digraphs)Paired Comparison Experiments (Cycles in Digraphs)Paired Comparison Experiments (Cycles in Digraphs)Paired Comparison Experiments (Cycles in Digraphs)
A psychologist presents a subject with sounds of five musical
instruments, two at a time, and asks the subject which of the two is more
soothing. The instruments are : an alto horn ( )A , a bassoon ( )B , a clarinet
( )C , a dudek ( )D , and an English horn ( )E . The results of the experiment
given to one person4 are displayed in Figure 4.
Dominance Experiment in a Paired Comparison Experiment
Figure 4
It is natural to think that if instrument i is more soothing than j , and that j is
more soothing than k then i should be more soothing than k . When this
happens we call the three sounds ( ), ,i j k a consistent transitive tripleconsistent transitive tripleconsistent transitive tripleconsistent transitive triple. In
Figure 4 the subject says the clarinet ( )C is more soothing than the bassoon
4 The results displayed in the dominance graph in Figure 4 could be the result of a single subject or the
consensus results from a group of people.
Section 3.5 Directed Graphs 7
( )B , and the bassoon ( )B is more soothing than the dudek ( )D . Since the
subject also said the clarinet ( )C was more soothing than the dudek ( )D , the
vertices ( ), ,C B D form a consistent transitive triple in the dominance graph.
In the dominance graph in Figure 4 there are 8 transitive triples:
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ){ }, , , , , , , , , , , , , , , , , , , , , , ,C B D A C B A C D A B D B E D E C D E A C E A D
In some cases, however, the individual may be “inconsistent.” For
instance, the dominance graph indicates the subject says the clarinet ( )C is
more soothing than the bassoon ( )B and that the bassoon ( )B is more
soothing than the English horn ( )E , but that the English horn ( )E is more
soothing than the clarinet ( )C . We call this triple ( ), ,C B E a triple cycletriple cycletriple cycletriple cycle (or 3333----
cyclecyclecyclecycle). The dominance graph in Figure 4 has 2 triple cycles:
( ) ( ){ }, , , , ,C B E A B E
From the point of view of a psychologist a triple cycle represents an
inconsistency in preferences. To determine the number of transitive triples
and triple cycles5 in a dominance graph in Figure
Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.Error! Reference source not found., we first compute the number of out-
degrees of the vertices, which are
( ) ( ) ( ) ( ) ( )od 3, od 2, od 2, od 0, od 3A B C D E= = = = =
One can show6 that if the vertices of a directed graph are numbered 1,2,…, n ,
then the number of transitive triples ( )TT and triple cycles ( )TC is given by
( ) ( )( )
( ) ( )
1
1od od 1 (number of transitive triples)
2
11 2 (number of triple cycles)
6
n
i
TT i i
TC n n n TT
=
= −
= − − −
∑
In our example, we find
5 We may also wish to find the number of transitive paths and cycles of different lengths other than just
paths of length three. 6 The proof of this result can be found in more advanced book in graph theory.
Section 3.5 Directed Graphs 8
( ) ( )( ) ( ) ( )( )
( )
( )( )
( )
1od 1 od 1 1 od 5 od 5 1
2
13 2+ 2 1+ 2 1+ 0 1 + 3 2
2
8
11 2
6
15 4 3 8
6
2
TT
TC n n n TT
= − + + −
= ⋅ ⋅ ⋅ ⋅ − ⋅
=
= − − −
= ⋅ ⋅ −
=
�
RRRRanking Vertices anking Vertices anking Vertices anking Vertices of a of a of a of a Directed Directed Directed Directed GraphGraphGraphGraph
The challenging task in athletics is ranking athletic teams that have not
played each other. There are over 100 teams in NCAA Division 1 football,
and every year the National Champion is lambasted by teams who were
ranked 2,3, … . The following strategy is an attempt to “order” teams in a
directed graph when teams do not play every other team. (In other words,
only a few vertices in the graph are connected by a directed edge.) The
strategy takes into account the level of competition each team competes
against. (If Team A beats a good team, then it is rewarded more than beating
a poor team, etc.) To make the numbers manageable, we consider only five
universities, Maine (M), New Hampshire (N), Rhode Island (R), Connecticut
(C), and Delaware (D), where Figure 5 shows the season results between
these teams. The direction of the edges indicates what team beat what team,
and the numbers on the edges indicate by how many points. For example
Maine beat New Hampshire by 21 points, and lost to Rhode Island by 7. We
have also indicated the won-lost record of each team, which would give
ammunition to fans from Delaware and New Hamphire that their team should
be ranked #1. On the other hand Maine beat New Hampshire, which was a
good team, by 21 so they might make an argument for their team too.
Section 3.5 Directed Graphs 9
Ranking Athletic Teams
Figure 5
The strategy in ranking these teams is to give Team A x more points
than Team B is Team A beat Team B by x points. In other words, we want to
give Maine 21 more points than New Hampshire, and we want to give
Connecticut 14 more points than Rhode Island, and so on. In other words we
want the following seven equations to hold:
7 New Hampshire over Conn by 7
3 New Hampshire over Delaware by 3
14 Connecticut over Rhode Island by 14
21 Delaware over Connecticut by 21
7 Delaware over Rhode Isl
N C
N D
C R
D C
D R
= +
= +
= +
= +
= + and by 7
7 Rhode Island over Maine by 7
21 Maine over New Hampshire by 21
R M
M N
= +
= +
What we have is 7 equations in 5 unknowns , , , ,N M C D R , and like most over-
determined linear systems, this system has no solution. In other words, we
can’t give Maine 21 more points than New Hampshire, since one could argue
that New Hampshire beat Connecticut (by 7), and Connecticut beat Rhode
Island (by 14) and Rhode Island beat Maine (by 7), so New Hampshire fans
could (and would) argue that they indirectly beat Maine by 21. So the
Section 3.5 Directed Graphs 10
argument goes, how can we assign numbers to N,C,D,R,M so each team is
satisfied? (As much as possible anyway.) The idea is to pick the variables
that minimizes the sum of squares (a democratic choice) of the difference of
between left and right hand sides of the equations. That is pick , , , ,N C D R M
so it minimizes
( ) ( ) ( ) ( )
( ) ( ) ( )
2 2 2 2
2 2 2
Sum of Squares 7 3 14 21
7 7 21
C N D N R C C D
R D M R N M
= + − + + − + + − + + −
+ + − + + − + + −
This problem is a standard problem in statistics and the answer gives the final
rankings of the five teams as
12.1 Maine ranaked #1
9.7 Delaware ranked #2
3.6 New Hampshire ranked #3
0.6 Rhode Island ranked #4
0.0 Connecticut ranked #5
M
D
N
R
C
=
=
=
=
=
(No doubt there would be some complaining of fans from teams ranked 2 and
3. Also note that if each of the five variables , , , ,M D N R C were increased by
1 in the sum of squares equation, so its not a actual value of the variables that
is important but the difference between them. So after obtaining the least
squares solution for the variables we rescaled them so the lowest value was 0,
which in this case was Connecticut.
The reason Maine came out on top having only a 1-1 record was due to
the fact they beat a 2-1 team by 21 points. This system takes into
consideration the level of teams played and the difference in scores between
winners and losers.
Section 3.5 Directed Graphs 11
ProblemsProblemsProblemsProblems
For the digraphs in Problems 1-6, find the adjacency matrix M . Then
compute 2M and 2M M+ and verify that the elements of these matrices
agree with the number of dominations in the graphs.
1.
2.
3.
4.
Section 3.5 Directed Graphs 12
5.
6.
7. Group DominanceGroup DominanceGroup DominanceGroup Dominance
The graph shown in Figure 5 shows the dominance of a group of four
classmates: Andy ( )A , Betty ( )B , Charlie ( )C , and Denise ( )D .
Figure 5
a) Construct the adjacency matrix M for this graph.
b) Is there a consensus leader for the group?
c) Compute 2M and interpret its elements.
d) Who is the group leader?
e) Which person is dominated by the most other people?
Section 3.5 Directed Graphs 13
8. RoundRoundRoundRound----Robin TournamentsRobin TournamentsRobin TournamentsRobin Tournaments
The graph shown in Figure 6 shows the results of a round-robin
tournament for baseball teams in the Yankee Conference.
Round-robin tournament graph
Figure 6
a) Construct the adjacency matrix M for this graph.
b) Is there a consensus leader for the group?
c) Compute 2M and interpret its elements.
d) Which team is the conference winner?
e) Which team is dominated by the most other teams?
9. Paired Comparison ExperimentPaired Comparison ExperimentPaired Comparison ExperimentPaired Comparison Experiment
The dominance graph shown in Figure 7 shows the preference of a group
of voters over political candidates.
a) Construct the adjacency matrix M for this graph.
b) Find the out-degrees of the vertices.
c) Find the number of transitive triples and triple cycles7.
d) Find the transitive triples and triple cycles in the graph.
7 It was interesting in the 2008 Democratic primary, one poll showed a majority of voters preferring Barack
Obama over Hillary Clinton, and Hillary Clinton over John Edwards in person-to-person face-offs.
However, these same voters preferred John Edwards over Barack Obama.
Section 3.5 Directed Graphs 14
Political Polling
Figure 7
10. Transitive GraphsTransitive GraphsTransitive GraphsTransitive Graphs
A dominance graph is called transitive transitive transitive transitive if the graph has no triple cycles.
Transitive graphs have the property that each vertex has a different out-
degree and thus possible to rank the vertices (teams) from first to last.
a) Show the dominance graph in Figure 8 is a transitive graph.
b) For transitive graphs, it is possible to find a Hamiltonian path (not a
closed tour) by moving from vertex to vertex in decreasing order of their
out-degree. Find the Hamiltonian path of this graph.
c) Draw a transitive graph with six vertices. Do you see the general
strategy for constructing transitive graphs of any size?
d) Draw a digraph with five vertices with one triple cycle.
Transitive graph
Figure 8
Section 3.5 Directed Graphs 15
11. Landau’s TheoremLandau’s TheoremLandau’s TheoremLandau’s Theorem
A theorem by Landau states that if some vertex u in a dominance graph
has a larger out-degree than all other vertices, then either u dominates all
other vertices v , or if it does not dominate a given vertex v , then u
dominates a third vertex w which in turn dominates v . What does the
theorem say in the language of round-robin tournaments? Verify this theorem
fro the dominance graphs in Problems 1-6.
12. Landau’s Theorem in Landau’s Theorem in Landau’s Theorem in Landau’s Theorem in the Yankee Conference the Yankee Conference the Yankee Conference the Yankee Conference
Suppose the football teams in the Yankee Conference play every other
team exactly once during the season. At the end of the season Maine has won
more games than any other team. However, Maine lost to Vermont. What
does Landau’s theorem say in the language of the Yankee Conference?
13. Food WebFood WebFood WebFood Web
On a certain island, the only living things are snails, birds, goats, thistles,
lions, people, and lettuce. The snails eat lettuce, the birds eat snails, the
goats eat lettuce and thistles, the people eat goats and lettuce, and the lion
eats goats and people. A directed graph where the vertices represent forms
of life and a directed edge from vertex u to vertex v means that u eats v is
called a food webfood webfood webfood web. Construct the food web for this ecological system.
14. SecondSecondSecondSecond----Stage DominancesStage DominancesStage DominancesStage Dominances
Let M be the adjacency matrix of 0s and 1s for a given directed graph.
Show that the thij element of the square 2M of the adjacency matrix
represents the number of second-stage dominances of vertex i over vertex j .
Hint: Recall how matrices are multiplied and note that the product 1 1 1⋅ =
indicates a second stage dominance, and that 0 1 1 0 0⋅ = ⋅ = does not.
15. OutOutOutOut----degree/Indegree/Indegree/Indegree/In----DegreeDegreeDegreeDegree Show that the sum of the out-degrees and in-
degrees of vertices in a directed graph are equal. Verify this fact for the
directed graph in Figure Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.. Hint: Very easy.
16. Directed Acyclic GraphDirected Acyclic GraphDirected Acyclic GraphDirected Acyclic Graph A directed acdirected acdirected acdirected acyclic graphyclic graphyclic graphyclic graph (denoted a DAGDAGDAGDAG) is a
directed graph that has no cycles of any length. That is, for any vertex u
there is no directed path that ends with itself. Roughly speaking, it means the
graph “flows” in one direction. Show that a DAG gives rise to a partial order
on the set of vertices, where u v≤ is defined as a directed path going from
vertex to u v .