Graph Theory
Graph Theory
Graph Theory
Graph Theory
Basic Concepts
A graph G is a pair of sets (V,E), where V is a set of vertices and E is a set of edge.
Graph with no loops is said to be simple or loop-free.
If G is finite, | V(G) | denotes the number of vertices in G, and is called the order of G
and E(G)denotes the number of edges in G, and is called the size of G.
If one allows more than one edge to join a pair of vertices, the result is then called a
multigraph.
The minimum of all the degrees of the vertices of a graph G is denoted by (G), and the
maximum of all the degrees of the vertices of G is denoted by (G).
If (G) = (G) = k, that is, if each vertex of G has degree k, then G is said to be k-
regular or regular of degree k. Usually, a 3-regular graph is called a cubic graph.
The vertex c of the graph G has degree 5 while the degree of c in G1 is 3. The degree
sequence of G is (2,2,3,5) while the degree sequence of G1 is (2,2,3,3).
In any non directed graph there is an even number of vertices of odd degree
If k = (G) is the minimum degree of all the vertices of a non directed graph G, then
In the definition of path, vertices and edges may be repeated. In fact, if v0 = vn, then P is
called a closed path. But ,on the other hand, if v0 vn then P is an open path.
P may have no edges at all, in which case, the length of P is zero,P is called a trivial path,
and V(P) is just the singletonset{v0}.
Path P is simple if all edges and vertices on the path are distinct except possibly the
endpoints.
An open simple path of length n has n + 1distinct vertices and n distinct edges, while a
closed simple path of length n has n distinct vertices and n distinct edges.
The trivial path is taken to be a simple closed path of length zero.
Path of length > 1with no repeated edges and whose endpoints are equal is called a
circuit.
A circuit may have repeated vertices other than the endpoints; A cycle is a circuit with no
other repeated vertices except its end points.Thus,a cycle is a simple circuit, and, in
particular, a loop is a cycle of length1.Of course, in a graph a cycle that is not a loop
must have length at least 3, but there may be cycles of length 2 in a multigraph.
Two paths in a graph are said to be edge-disjoint if they share no common edges; they
are vertex-disjoint if they share no, common vertices.
Two graphs G and G1 are isomorphic if there is a function f:V(G)V(G1) from the
vertices of G to the vertices of G1 such that
(i) f is one-to-one,
(ii)f is onto,and
(iii) for each pair of vertices u and v of G,{u,v}E(G) iff {f(u),f(v)}E(G1).
The condition (iii) says that vertices u and v are adjacent in G iff f(u) and f(v) are
adjacent in G'. In other words, we say that the function f preserves adjacency.
if G and G1 are isomorphic graphs the isomorphism f is by no means unique, there may
be several isomorphisms from G to G1 But if such an isomorphism f exists, then there are
several conclusions we can make, namely,
1. |V(G)|=|V(G')|
2. E(G)=E(G1)
3. If v V(G) , then degG(v)= degG(f(v)) and, thus, the degree sequences of G and G1 are
the same.
In particular, the cycle vectors of G and G1 are equal, where the cycle vector of G is by
definition the vector (c1 ,c2… cn) where ci is the number of cycles in G of length i. Of
course, c1 = 0 for simple graphs and c2 is nonzero only for multigraphs.
Discovering Isomorphism
v1,v2....vn are the vertices of G, then the adjacency matrix for this ordering of the vertices
of G is the n x n matrix A, where the ij th entry (i,j) of A is 1 iff the edge {vi,vj} is an edge
of G; otherwise, A (i,j) = 0.
Suppose that G and G' are two graphs and that f: V(G)V(G1) is a one-to-one onto
function. Let A be the adjacency matrix for the vertex ordering v1,v2…. vn.of the vertices
of G.
Let A' be the adjacency matrix for the vertex ordering f( v1),f(v2)..f(vn) . Then f is an
isomorphism from V(G) to V(G') iff the adjacency matrices A and A' are equal.
In this case, both of these maps are isomorphisms. For instance, we can verify that the
map f which maps a to c', b to b', c to a' , d to d', and e to e' is an isomorphism because
the adjacency matrix for G for the ordering a,b,c,d,e and the adjacency
matrix for G' for the ordering f(a) = c',f(b)= b' f(c) = a', f(d) = d',f(e) = e' is the matrix.
If G and H are graphs then if is a subgraph of G iff V(H) is a subset of V(G) and E(H) is a
subset of E(G).
A simple non directed graph with n mutually adjacent vertices is called a complete graph
on n vertices, and may be represented by the symbol kn.
A complete graph on n verticeshas n (n-1)/2 edges, and each of its vertices has degree n-1.
Any graph may be viewed as made up of "building blocks" which are complete
subgraphs.
For example,both graphs in the following consist of two K3 graphs joined at a common
edge, a K2 graph, and a loop.
It follows from this definition that V(Hc) = V(H) and any two vertices are adjacent in Hc
if and only if they are not adjacent in H. Note that the degree of a vertex in Hc plus its
degree in H is n - 1,where n = |V(H).
Let G and G' be two graphs. The intersection of G and G1 written G G1 is the graph
whose vertex set is V(G) V(G1) and whose edge set is E(G) E(G').
Similarly, the union of G and G1 is the graph with vertex set V(G) V(G1) and edge set
E(G) E(G1).
In general, if G is a simple graph with n vertices, then G G1 is a complete graph on n
vertices.
Special Graphs
A cycle graph of order n is a connected graph whose edges form a cycle of length n.
Cycle graphs are denoted by Cn.
A wheel of order n is a graph obtained by joining a single new vertex (the "hub") to each
vertex of a cycle graph of order n - 1. Wheels of order n are denoted by Wn.
A path graph of order n is obtained by removing an edge from a C n graph. Path graphs
of order n are denoted by Pn.
Figure Description
a K5
b C5
c W5
d P5
e N5
A bipartite graph is a non directed graph whose set of vertices can be partitioned into
two sets M and N in such a way that each edge joins a vertex in M to a vertex in N.
A complete bipartite graph is a bipartite graph in which every vertex of M is adjacent to
every vertex of N.
The complete bipartite graphs that may be partitioned into sets M and N as above such
that |M= m and |N= n are denoted by Km,n (where we normally order m and n such
that m < n).
Figure Description
a K3,3
b K2,4
c K1,5
Planar Graphs
a planar graph is a plane graph if it is already drawn in the plane so that no two edges
cross over.
Suppose we have three houses and three utility outlets (electricity, gas, and water)
situated so that each utility outlet is connected to each house. Is it possible to connect
each utility to each of the three houses without lines or mains crossing.
Find a systematic way to draw a graph in the plane without edges crossing. We want to
be able to conclude that a graph is non planar if our construction fails. The method
we will use involves two simple ideas:
1. If we have drawn a cycle in the plane, then any edge not on the cycle must be either
inside the cycle, outside the cycle, or the edge must crossover one of the edges of the
cycle.
2. The roles of being inside or outside the cycle are symmetric that is,the graph can be
redrawn so that edges and vertices formerly outside the cycle are now inside the cycle
and vice versa
A plane graph G can be thought of as dividing the plane into regions or faces. Intuitively
the regions are the connected portions of the plane remaining after all the curves and
points of the plane corresponding, respectively, to edges and vertices of G have been
deleted.
Each plane graph G determines a region of infinite area called the exterior region of G.
The vertices and edges of G incident with a region r make up the Boundary of the region
r. If G is connected, then the boundary of a region r is a closed path in which each cut-
edge is traversed twice.
When the boundary contains no cut edges of G, then the boundary of r is a cycle of G.
In either case, the degree of r is the length of its boundary. Of course, a cycle of G need
not be the boundary of a region.
i. | E* |= | E|
ii. |V* |= | R| and
iii. DegG * (r*) = DegG (r) for each region r of G. Moreover ,if G is connected, it can
be shown that
iv. |R*|=|V|.
In (iii) we mean that the degree of the vertex r* in G* is the same as the degree of the
corresponding region r determined by G.
If G is a plane graph, then the sum of the degrees of the regions determined by
G is 2| E|, where | E| is the number of edges of G.
An Euler path in a multigraph is a path that includes each edge of the multigraph exactly
once and intersects each vertex of the multigraph at least once.
A multigraph is said to be traversable if it has an Euler path.
An Euler circuit is an Euler path whose endpoints are identical. (That is, if
an Euler path is a sequence of edges e1 ,e2….ek corresponding to the sequence of pairs of
vertices(x1,x2),(x2,x3)….,(xk-1,xk) then the then the ei’s are all distinct, and x1=xk)
A non directed multigraph has an Euler path iff it is connected and has 0 or exactly 2
vertices of odd degree. In the latter case, the two vertices of odd degree are the
endpoints of every Euler path in the multigraph.
A non directed multigraph has an Euler circuit iff it is connected and all of its vertices are
of even degree.
A directed multigraph G has an Euler path iff it is unilaterally connected and the in-
degree of each vertex is equal to its out-degree, with the possible exception of two
vertices, for which it may be that the in-degree of one is one larger than its out-degree
and the in-degree of the other is one less than its out-degree.
A directed multigraph G has an Euler circuit iff G is unilaterally connected and the in-
degree of every vertex in G is equal to its out-degre.
The problem of drawing a multigraph on paper with a pencil without lifting the pencil or
repeating any lines is clearly a problem of finding an Euler path in the multigraph.
A multigraph can be drawn in this way iff it has an Euler path.
Hamiltonian Graphs
Suppose that a traveling salesman's territory includes several cities with roads connecting
certain pairs of these cities. Suppose additionally that the salesman's job requires that he
visit each city personally. Is it possible for him to schedule a roundtrip by car enabling
him to visit each specified city exactly once.
Whereas the Euler circuit is a circuit that traverses each edge exactly once and, therefore,
traverses each vertex at least once, a Hamiltonian cycle traverses each vertex exactly
once.
A Hamiltonian cycle always provides a Hamiltonian path, upon deletion of any edge.
On the other hand, a Hamiltonian path may not lead to a Hamiltonian cycle (it depends
on whether or not the end points of the path happen to be joined by an edge in the
graph).
Rule 1. If G has n vertices, then a Hamiltonian path must contain exactly n - 1 edges, and
a Hamiltonian cycle must contain exactly n edges.
Rule 2. If a vertex v in G has degree k, then a Hamiltonian path must contain at least one
edge incident on v and at most two edges incident on v. A Hamiltonian cycle will, of
course, contain exactly two edges incident on v. In particular, both edges incident on a
vertex of degree two will be contained in every Hamiltonian cycle. In sum: there cannot
be three or more edges incident with one vertex in a Hamiltonian cycle.
Rule 3. No cycle that does not contain all the vertices of G can be formed when building
a Hamiltonian path or cycle.
Rule 4. Once the Hamiltonian cycle we are building has passed through a vertex v, then
all other unused edges incident on v can be deleted because only two edges incident on
v can be included in a Hamiltonian cycle
Dirac's Theorem. A simple graph with n vertices (n >= 3) in which each vertex has
degree at least n/2 has a Hamiltoniancycle.
If G is a complete simple graph on n-vertices (n > =3), then G has a Hamiltonian cycle.
(is true even for directed graphs).
Chromatic Number
Suppose that the state legislature has a list of 21 standing committees. Each committee is
supposed to meet one hour each week. What is wanted is a weekly schedule of
committee meeting times that uses as few different hours in the week as possible so as to
maximize the time available for other legislative activities. The one constraint is that no
Legislator should be scheduled to be in two different committee meetings at the same
time. The question is: What is the minimum number of hours needed for such a schedule?
First, we model this problem with a "committee" graph G0 that has a vertex for each
committee and has an edge between vertices corresponding to committees with a
common member. But then we need to introduce a new graph theoretic concept.
By a vertex coloring of a graph G, we mean the assignment of colors (which are simply
the elements of some set) to the vertices of G, one color to each vertex, so that adjacent
vertices are assigned different colors.
An n-coloring of G is a coloring of G using n colors. If G has an n-coloring then G is said
to be n-colorable.
The question is: What is the minimum number of colors required? We define the
chromatic number of a graph G to be the minimum number n for which there exists an
n-coloring of the vertices of G. We denote the chromatic number of G by (G), and if
(G) = k we say that G is k-chromatic.
(G)=4.
Rule 2. A triangle always requires three colors, that is, (K3)= 3;more generally, (Kn) =
n where Kn is the complete graph on n vertices.
Rule 4. If degree (v) = d, then at most d colors are required to color the vertices
adjacent to v.
Rule 6. Every k-chromatic graph has at least k vertices v such that degree (v) >= k -1.
Rule 7. For any graph G, (G) <= 1 + (G), where (G) is the largest degree of any
vertex of G.
Rule 8. When building a k-coloring of a graph G, we may delete all vertices of degree
less than k (along with their incident edges). In general, when attempting to build a k-
coloring of a graph, it is desirable to start by k-coloring a complete subgraph of k vertices
and then successively finding vertices adjacent to k - 1 different colors, thereby forcing the
color choice of such vertices.
A graph G to be k-critical if (G) = k and (G - v) < (G) for each vertex v of G. It is
easy to see that a k-chromatic graph has a k-critical subgraph.
Directed Trees
Under what conditions does a digraph have a directed spanning tree? The answer
requires us to give a characterization of directed trees and of quasi-strongly connected
graphs.
Of course, if there is a directed path P from u to v then certainly u and v are quasi-
strongly connected, because we may take w to be u itself, and then there is the trivial
path with no edges from u to u and the path P from u to v.
In the graph of Figure (a) the vertex e is special in the sense that there is a directed path
from e to every other vertex.
Let G be a digraph with n > 1 vertices. Then the following statements are equivalent:
1. G is a directed tree.
2. There is a vertex r in G such that there is a unique directed path from r to every other
vertex of G.
3. G is quasi-strongly connected and G - e is not quasi-strongly connected for each edge e
of G.
4. G is quasi-strongly connected and contains a vertex r such that the in-degree of r is
zero (that is, deg+(r)= 0)and deg+(v) = 1 for each vertex v r.
5. G has no circuits (that is, G has no directed circuits and no non directed circuits) and
has a vertex r such that deg+(r)= 0and deg+(v) = 1 for each vertex v r.
6. G is quasi-strongly connected without circuits.
7. There is a vertex r such that deg+(r)= 0and deg+(v) = 1 for each vertex v r and the
underlying non directed graph of G is a tree.
There are between 0 and kL vertices at level L in any directed tree of degree k.
There are between h + k and (Kh+1-1)/(k-1) vertices in a directed tree of height h and
degree k.
Complete Tree with Degree 3
A complete (directed) tree of degree k has the maximum possible number (exactly kL) of
vertices in each level, except possibly the last.
There are between (Kh+k-2)/(k-1) and (kh+1 -1)/(k-1) vertices in a complete directed tree of
degree k and height h.
A B-tree of order k and height h has at least 2 k/2h-1 leaves, for h >= 1.
A tree is a simple graph G such that there is a unique simple non directed path between
each pair of vertices of G.
A rooted tree is a tree in which there is one designated vertex, called a root. A rooted
tree is a directed tree if there is a root from which there is a directed path to each vertex.
The level of a vertex v in a rooted tree is the length of the path to v from the root.
A tree T with only one vertex is called a trivial tree; otherwise T is a nontrivial tree.
A tree may be either a digraph or a non directed graph. Note that in a tree any vertex
may be designated as a root.
Neither of above trees is a directed tree. If vertex c is designated as the root of each tree,
vertex j is at level 4 in G1 and at level 3 in G2.
Directed Tree
Trees arise in many practical applications; frequently they occur in situations where many
elements are to be organized into some sort of hierarchy that expresses what is more
important, what must be done first, or what is more desirable.
For instance, a tree can be used to show the order in which tasks are to be completed in
the assembly of some product; the root can represent the finished product, and tasks that
can be done concurrently appear on the same level, whereas if task A must ‘be
completed before task B can start, then A would have to lie on a higher level than B.
Two vertices a and b of a graph are said to be connected iff there is a non directed path
from a to b in G, and then the graph G is connected iff each pair of its vertices is
connected.
In general, if we define the relation R on the vertices of a graph G by aRb iff a and b are
connected, then R is an equivalence relation. Consequently, the vertices of G can be
partitioned into disjoint nonempty sets V1, V2….Vk and the sub graphs H1, H2…. HK
of G induced by respectively, are called the connected components of G or simply the
components of G.(C(G)).
An undirected graph is called connected if there is path between every pair of distinct
vertices.
A graph that is not connected is the union of two or more connected sub graphs each of
which has no vertex common. These disjoint connected sub graph are called conned
components of G.
If a graph G is connected and e is an edge such that G - e is not connected, then e is said
to be a bridge or a cut edge.
If v is a vertex of G such that G-v not connected, then v is a cut vertex.
A simple non directed graph G is a tree iff G is connected and contains no cycles.
In every nontrivial tree there is at least one vertex of degree 1.(We are excluding the
trivial tree with only one vertex.)
If two non adjacent vertices of a tree T are connected by adding an edge, then the
resulting graph will contain a cycle.
If G is a simple graph with C(G) connected components, if e is any edge of G, then G-e
at most C(G) + 1 components.
In particular if, G is a forest, than G - e has exactly C(G) + 1 components.
For a simple graph G with C(G) connected components the number of edges of G that
V(G)=C(G)+E(G).
A graph with no vertices of odd degree and no vertices of degree 0 must contain a
circuit.
Spanning Trees
A non directed graph G is connected if and only if G contains a spanning tree. Indeed, if
we successively delete edges of cycles until no further cycles remain, then the result is a
spanning tree of G.
Method:
2. (Add new edges.) Consider the vertices of V in order consistent with the original
labeling. Then for each vertex x V, add the edge {x,vk} to T where k is the minimum
index such that adding the edge {x,vk} to T does not produce a cycle.
3. (Update V.) Replace V by all the children v in T of the vertices x of V where the edges
{x,v} were added in Step 2. Go back and repeat Step2 for the new set V.
Method:
1. (Visit a vertex.) Let v1 be the root of T, and set L – v1 (The name L stands for the
vertex last visited.)
For all vertices adjacent to L, choose the edge{L,vk}, where k is the minimum index
suchthat adding{L,vk} to T does not create a cycle.
If no such edge exists, goto Step3;otherwise, add edge {L,vk} to T and set L = vk repeat
Step 2 at the new value for L.