4. Graph Theory
4. Graph Theory
4. Graph Theory
Graph Theory
What are the degrees and what are the neighborhoods of the
vertices in the graph G?
Soln :- In G, deg(a) = 2, deg(b) = deg(c) = deg(f ) = 4, deg(d) = 1,
deg(e) = 3, and deg(g) = 0.
The neighborhoods of these vertices are N(a)={b,f}, N(b)={a,c,e,f},
N(c)={b,d,e,f}, N(d)={c}, N(e)={b,c,f}, N(f)={a,b,c,e}, and N(g)=∅.
Example :- How many edges are there in a graph with 10 vertices each of degree six?
Solution: Because the sum of the degrees of the vertices is 6 · 10 = 60, it follows that 2m = 60 where m is the number of
edges. Therefore, m = 30.
Defn :- When (u,v) is an edge of the graph G with directed edges, u is said to be adjacent to v and v is said to be adjacent
from u. The vertex u is called the initial vertex of (u,v), and v is called the terminal or end vertex of (u,v). The initial vertex
and terminal vertex of a loop are the same.
Because the edges in graphs with directed edges Q. Find the in-degree and out-degree of each vertex in the graph
are ordered pairs, the definition of the degree of a G with directed edges shown in Figure 2.
vertex can be refined to reflect the number of edges
with this vertex as the initial vertex and as the Solution: The in-degrees in G are deg−(a) = 2, deg−(b) = 2, deg−
terminal vertex. (c) = 3, deg−(d) = 2, deg−(e) = 3, and
←Ans
Use an adjacency matrix to represent the graph shown
in Figure 3.
Adjacency Matrices
GRAPH. when this edge connects two vertices already in G.We denote by G +
e the new graph produced by adding a new edge e, connecting two
previously non incident vertices, to the graph G Hence,
Graphs
Q. Show that the graphs G = (V,E) and H = (W,F), displayed in Figure 8,
are isomorphic.
Solution: The function f with f(u1) = v1, f(u2) = v4, f(u3) = v3, and
f(u4) = v2 is a one to-one correspondence between V and W. To see
that this correspondence preserves adjacency, note that adjacent
vertices in G are [u1 and u2], [u1 and u3], [u2 and u4], and [u3 and u4],
and each of the pairs [f(u1) = v1] and [f(u2) = v4], [f(u1) = v1] and
[f(u3) = v3], [f(u2) = v4] and [f(u4) = v2], and [f(u3) = v3] and [f(u4) =
v2] consists of two adjacent vertices in H.
Determining
1. Isomorphic simple graphs must have the same
number of vertices, because there is a
Simple Graphs are 2. Isomorphic simple graphs also must have the
same number of edges, because the one-to-one
Isomorphic correspondence between vertices establishes a
one-to-one correspondence between edges.
3. In addition, the degrees of the vertices in
isomorphic simple graphs must be the same.
That is, a vertex v of degree d in G must
correspond to a vertex f(v) of degree d in H,
because a vertex w in G is adjacent to v if and
only if f(v) and f(w) are adjacent in H.
Q. Show that the graphs displayed in Figure Solution: Both G and H have five vertices and six
9 are not isomorphic. edges.However, H has a vertex of degree one, namely,
e, whereas G has no vertices of degree one.It follows
that G and H are not isomorphic.
Euler Paths and Solution: The graph G1 has an Euler circuit, for example,
a,e,c,d,e,b,a. Neither of the graphs G2 or G3 has an Euler circuit.
Circuits However, G3 has an Euler path, namely, a,c,d,e,b,d,a,b. G2 does
not have an Euler path.
Euler Paths and
E.g. 2 Which of the directed graphs in Figure 4 have an
Euler circuit? Of those that do not, which have an Euler
Circuits path?
Circuits