Graph Theory

Graph Theory
[Lots of examples of relations among members of a set:]
Set:
people, animals, countries, companies, sports teams, cities
Relation between two members E and F :
Person E dominates person F
Animal E feeds on animal F
Country E militarily supports country F
Company E sells its product to company F
Sports team E consistently beats sports team F
City E has a direct airline flight to city F
Modeling: Directed graphs
Def. A directed graph is a finite set of elements T" ,á ,T8 , together with a finite
collection of ordered pairs ÐT3 ß T4 Ñ of elements, with no ordered pair repeated.
The elements of the set are called vertices, and the ordered pairs are called
directed edges of the directed graph.
We use notation T3 Ä T4 to denote the fact that the edge ÐT3 ,T4 ) belongs to the
directed graph.
Geometrical visualization: arrow from T3 to T4 represents a directed edge from
T3 to T4 Þ
fig 1: Sample digraph
fig 2: Some other sample digraphs
If a digraph K has 8 vertices, associate 8 ‚ 8 vertex matrix Q with K:
"
734 œ œ
!
if T3 Ä T4
.
otherwise
For the above 3 digraphs, the corresponding vertex matrices are:
Ô!
Ö!
Q" œ Ö
!
Õ!
Ô!
Ö!
Ö
Q# œ Ö !
Ö
!
Õ!
Ô!
Ö"
Q$ œ Ö
"
Õ"
"
!
"
!
"
!
!
"
"
!
"
!
!
"
"
!
!
!
!×
!Ù
Ù
"
!Ø
!
"
!
!
!
"
"
!
!
!
"
!
!
"×
!Ù
Ù
!Ù
Ù
"
!Ø
!×
!Ù
Ù
"
!Ø
Note: all entries either ! or "; all diagonal entries are 0.
Note: vertex matrix uniquely determines connectivity of the graph.
Ex. Moves on a chessboard:
fig. 3: Knight on a 3 ‚ 3 chessboard
Motion of knight in chess: P pattern.
Graph of possible moves by knight on chessboard:
Fig. 4: Possible moves of knight on chessboard
Note: above two graphs are equivalent.
Vertex matrix:
Ô!
Ö!
Ö
Ö!
Ö
Ö!
Ö
Q œ Ö!
Ö
Ö"
Ö
Ö!
Ö
"
Õ!
!
!
!
!
!
!
"
!
"
!
!
!
"
!
!
!
"
!
!
!
"
!
!
!
!
!
"
!
!
!
!
!
!
!
!
!
"
!
!
!
!
!
"
!
!
!
"
!
!
!
"
!
!
!
"
!
"
!
!
!
!
!
!
!×
"Ù
Ù
!Ù
Ù
"Ù
Ù
!Ù
Ù
!Ù
Ù
!Ù
Ù
!
!Ø
Ex. Influences in a family: Mother, Father, Daughter, Older son, Younger son:
Graph;
Fig. 5: Family influence diagram
Q J
H SW ] W
Ô Q ×Ô !
Ö J ÙÖ !
Ö
ÙÖ
Ö H ÙÖ !
Ö
ÙÖ
SW
!
Õ ] W ØÕ "
!
!
"
!
!
"
!
!
!
!
"
"
!
!
!
!×
"Ù
Ù
!Ù
Ù
"
!Ø
Note: father cannot directly influence mother; but: can influence youngest son,
who can influence mother:
J Ä ]W Ä Q
#-step connection from J to Q .
J Ä SW Ä ] W Ä Q
is a 3-step connection.
How to find all possible <  step connections?
1-step connections: There is a 1-step connection from vertex 3 to vertex 4 if
734 œ "Þ
Now square Q :
Ð#Ñ
Q # œ Ð734 ÑÞ
Ð#Ñ
7$% œ 7$" 7"%  7$# 7#%  7$$ 7$%  á  7$8 78%
(1)
Note: If 7$# œ " and 7#% œ ", there is a two step connection from T$ to T%
(via T# ÑÞ If 7$& œ " and 7&% œ ", there is another two step connection from T$
to T% , this time through T& . The sum in (1) gives total number of two step
connections from T$ to T% .
[Similar argument gives: ]
Ð<Ñ
Theorem: Let M be the vertex matrix of a digraph and let m34 be the Ð3ß 4Ñ
Ð<Ñ
element of Q < . Then 734 is equal to the number of different <  step
connections from T3 to T4 .
Example: Small airline; 4 cities; graph:
Fig. 6: Airline graph
Ô!
Ö"
Q υ
"
Õ!
"
!
!
"
"
"
!
"
!×
!Ù
Ù
"
!Ø
Ô#
Ö"
Q# œ Ö
!
Õ#
!
"
#
!
"
"
#
"
"×
"Ù
Ù
!
"Ø
Ô"
Ö#
Q$ œ Ö
%
Õ"
$
#
!
$
$
$
#
$
"×
"Ù
Ù
#
"Ø
Can now find numbers of multi-step connections from T% to T$ :
1 one step
1 two step
3 three step
Cliques:
Definition: A subset G of a digraph is a clique if it satisfies the following:
(i) The subset contains at least three vertices
(ii) For each pair of vertices in G , T3 Ä T4 and T4 Ä T3 are true
(iii) The subset is as large as possible, i.e., it's not possible to add another
vertex and still satisfy condition (ii)
Example:
Fig. 7: Example graph with 3 cliques: ÖT$ ß T' ß T% ×ß ÖT" ß T# ß T% ×ß ÖT" ß T$ ß T% ×
[for large graphs cliques are very hard to find; can use the following theorem]:
Define alternative connection matrix W :
=34 œ œ
"
!
if T3 Ç T4
otherwise
where Ç denotes connections in both directions between T3 and T4 .
Ex. The graph below on the left is an example of a digraph (with matrix Q ); the
digraph that has W as its matrix is shown below; notice only bidirectional edges
are kept, and all others are deleted:
Figure 8: A digraph with a matrix Q and corresponding digraph with
corresponding matrix W
Ð$Ñ
Theorem: Let =34 be the Ð3ß 4Ñ element of W $ . Then a vertex T3 belongs to some
Ð$Ñ
clique iff the diagonal entry =33 Á !.
Ð$Ñ
Proof: By the same arguments as earlier, in this modified matrix, =34 Á ! means
there is a 3-step multi-connection from T3 to itself À
T 3 Ç T4 Ç T5 Ç T3 Þ
But this means that T3 , T4 ß T5 is a clique or part of a larger clique. …
Example:
Ô!
Ö"
Q υ
!
Õ"
"
!
"
!
"
"
!
!
"×
!Ù
ÙÞ
"
!Ø
Ô!
Ö"
Wυ
!
Õ"
"
!
"
!
!
"
!
!
"×
!Ù
Ù
!
!Ø
Ô!
Ö$
W$ œ Ö
!
Õ#
$
!
#
!
!
#
!
"
#×
!Ù
Ù
"
!Ø
Associated connection matrix W :
All diagonal entries are 0 Ê no cliques in the graph with matrix Q
Ex:
Ô!
Ö"
Ö
Q œ Ö"
Ö
"
Õ"
"
!
"
"
!
!
!
!
!
!
"
"
"
!
"
"×
!Ù
Ù
!Ù
Ù
!
!Ø
Ô!
Ö"
Ö
W œ Ö!
Ö
"
Õ"
"
!
!
"
!
!
!
!
!
!
"
"
!
!
!
"×
!Ù
Ù
! Ùà
Ù
!
!Ø
Ô#
Ö%
Ö
$
W œ Ö!
Ö
%
Õ$
%
#
!
$
"
!
!
!
!
!
%
$
!
#
"
$×
"Ù
Ù
!Ù
Ù
"
!Ø
Thus T" ß T# , T% belong to cliques. Because a clique must contain 3 vertices,
graph has only one clique, T" ß T# ß T% Þ
Dominance directed graphs:
In many groups of individuals there is a "dominance hierarchy" or "pecking
order" - who dominates whom. For any two individuals E and F, either E
dominates F or vice versa, but not both.
For graphs, if the relation is domination, then for each T3 and T4 , either T3 Ä T4
or T4 Ä T3 , but not both
Example: League of sports teams. Teams play each other exactly once, with no
ties allowed. T3 Ä T4 means team T3 beat team T4 .
Examples of dominance-directed graphs:
Note: circled vertices have the property that from each there is a 1- or 2-step
connection to any other vertex in the graph, i.e., most "powerful" teams.
Theorem: In any dominance-directed graph there is at least one vertex from
which there is a 1-step or 2-step connection to any other vertex.
Note:
if matrix is Q , then non-zero entries of Q correspond to 1-step
connections between two vertices; and non-zero entries of Q # correspond to 2step connections. Thus non-zero entries +34 of Q  Q # correspond to existence
of 1 or two-step connections from T3 to T4 .
Fact: the vertex T3 with the property that row 3 of Q  Q # has the largest sum
is the vertex referred to in above theorem, i.e., the vertex with a 1 or 2 step
connection to every other vertex (there may be more than 1 such vertex though).
Example: 5 soccer teams T" á T& play each other exactly once; results are as
below:
Ô!
Ö"
Ö
Q œ Ö!
Ö
!
Õ"
!
!
!
"
!
"
"
!
!
"
"
!
"
!
"
!×
"Ù
Ù
!Ù
Ù
!
!Ø
Ô!
Ö"
Ö
#
E œ Q  Q œ Ö!
Ö
!
Õ"
!
!
!
"
!
"
"
!
!
"
"
!
"
!
"
!× Ô!
"Ù Ö"
Ù Ö
!Ù  Ö!
Ù Ö
!
"
Ø
Õ
!
!
"
!
"
!
"
!
#
!
"
"
"
$
!
!
#
!× Ô!
!Ù Ö#
Ù Ö
!Ù œ Ö!
Ù Ö
"
"
Ø
Õ
!
"
"
!
"
"
"
"
$
!
"
#
#
$
"
!
$
!×
"Ù
Ù
!Ù
Ù
"
!Ø
Row sums:
Row 1: 4
Row 2: 9
Row 3: 2
Row 4: 4
Row 5: 7
Second row: largest row sum Ê T# must have a 1 step or 2 step connection to
every other team.
We define power of a team to be the number of 1 and 2 step connections to other
teams; thus the row sums above are the powers of teams T" to T& ; can rank
teams in this way.