L2
L2
L2
Some Special Simple Graphs
• Null graph
• A graph which contains only isolated node, is called a null graph.
i.e., the set of edges in a null graph is empty.
• Null graph is denoted on n vertices by
Some Special Simple Graphs
Complete Graphs
• A simple graph G is said to be complete if every vertex
in G is connected with every other vertex.
• i.e if G contains exactly one edge between each pair
of distinct vertices.
• The graphs Kn for n = 1, 2, 3, 4, 5, 6 are show
CIRCLES
Some Special Simple Graphs
Wheels
• We obtain the wheel Wn when we add an
additional vertex to the cycle Cn, for n≥ 3, and
connect this new vertex to each of the n vertices
in Cn, by new edges.
• Regular graph
• A graph in which all vertices are of equal degree, is called a regular
graph.
• If the degree of each vertex is r, then the graph is called a regular graph
of degree r.
• Note that every null graph is regular of degree zero, and that the
complete graph is a regular of degree n – 1.
• Also, note that, if G has n vertices and is regular of degree r, then G has
r n edges.
Some Special Simple Graphs
Bipartite Graphs
• A simple graph G is called bipartite if its vertex set
V can be partitioned into two disjointSets VI and
V2 such that every edge in the graph connects a
vertex in VI and a vertex in V2 (so that no edge in G
connects either two vertices in VI or two vertices
in V2).
• When this condition holds, we call the pair (V1, V2)
a bipartition of the vertex set V of G.
Bipartite Graphs
C 6 is bipartite, as shown in Figure above, because its vertex set can be partitioned into the
two sets VI = {v1, v3, v5} and V2 = {V2, V4, V6}, and every edge of C6 connects a vertex in VI
and a Vertex in V2.
Bipartite Graphs
• K3 is not bipartite.
• To verify this, note that if we divide the vertex set of
K3 into two disjoint sets, one of the two sets must
contain two vertices.
• If the graph were bipartite, these two vertices could
not be connected by an edge, but in K3 each vertex is
connected to every other vertex by an edge.
Bipartite Graphs
• Are the graphs G and H displayed in Figure 8
bipartite?
Bipartite Graphs
Solution:
• Graph G is bipartite because its vertex set is the union of two
disjoint sets, {a, b, d} and {c, e, f, g}, and each edge connects a
vertex in one of these subsets to a vertex in the other subset.
• (Note that for G to be bipartite it is not necessary that every
vertex in {a, b, d} be adjacent to every vertex in {c, e, f, g}. For
instance, band g are not adjacent.)
• Graph H is not bipartite because its vertex set cannot be
partitioned into two subsets so that edges do not connect two
vertices from the same subset.
• (The reader should verify this by considering the vertices a, b,
and f.)
Bipartite Graphs
• THEOREM
• A simple graph is bipartite if and only if it is
possible to assign one of two different colours to
each vertex of the graph so that no two adjacent
vertices are assigned the same colour.
Example
• Using the Theorem above determine whether the graphs G and H above are bipartite.
• Solution: We first consider the graph G. We will try to assign one of two colours, say
red and blue, to each vertex in G so that no edge in G connects a red vertex and a blue
vertex.
• Without loss of generality we begin by arbitrarily assigning red to a.
• Then, we must assign blue to c, e, f, and g, because each of these vertices is adjacent
to a.
• To avoid having an edge with two blue endpoints, we must assign red to all the
vertices adjacent to either c, e, f, or g.
• This means that we must assign red to both band d (and means that a must be
assigned red, which it already has been). We have now assigned colours to all vertices,
with a, b, and d red and c, e, f, and g blue.
• Checking all edges, we see that every edge connects a red vertex and a blue vertex.
Hence, by
• Theorem 4 the graph G is bipartite.
• Next, we will try to assign either red or blue to each vertex in H so that no
edge in H connects a red vertex and a blue vertex.
• Without loss of generality we arbitrarily assign red to a.
• Then, we must assign blue to b, e, and f, because each is adjacent to a.
• But this is not possible because e and f are adjacent, so both cannot be
assigned blue.
• This argument shows that we cannot assign one of two colours to each of
the vertices of H so that no adjacent vertices are assigned the same colour.
• It follows by Theorem 4 that H is not bipartite.
• Theorem 4 is an example of a result in the part of graph theory known as
graph colourings.
• Graph colourings is an important part of graph theory with important
applications.
Bipartite Graphs and Matching
• Bipartite graphs can be used to model many types of applications that
involve matching the elements of one set to elements of another
• Example Job Assignments, marriages etc
SUBGRAPH
Representing Graphs
• One way to represent a graph without multiple
edges is to list all the edges of this graph.
• Another way to represent a graph with no
multiple edges is to use adjacency lists, which
specify the vertices that are adjacent to each
vertex of the graph.
Example
• Use adjacency lists to describe the simple graph below
Example
• Represent the directed graph shown in Figure below by listing all the
vertices that are the terminal vertices of edges starting at each vertex
of the graph.
Adjacency Matrices
• Carrying out graph algorithms using the representation of graphs by
lists of edges, or by adjacency lists, can be cumbersome if there are
many edges in the graph.
• To simplify computation, graphs can be represented using matrices.
• Two types of matrices commonly used to represent graphs will be
presented here.
• One is based on the adjacency of vertices, and the other is based on
incidence of vertices and edges
• Suppose that G = (V, E) is a simple graph where IVI = n. Suppose that
the vertices of G are listed arbitrarily as v1, v2. . . v n .
• The adjacency matrix A (or A G ) of G, with
respect to this listing of the vertices, is the n x n
zero-one matrix with 1 as its (i, j)th entry when vi
and Vj are adjacent, and 0 as its (i, j)th entry
when they are not adjacent. In other words, if its
adjacency matrix is A = [a ij]' then
• Example Use an adjacency matrix to represent the graph
•Solution: We order the vertices as a,
b, c, d. The matrix representing this
graph is
• The adjacency matrix of a simple graph is
symmetric, that is, aij = a ji, because both of
these entries are 1 when Vj and Vi are adjacent,
and both are 0 otherwise.
• Furthermore, because a simple graph has no
loops, each entry aij i = 1, 2, 3. . . n, is o.
•
• END