0% found this document useful (0 votes)
2 views117 pages

module 4 (3)

This document covers Module 4 of a course on Discrete Mathematical Structures, focusing on Graph Theory and its applications. It includes definitions, properties, and concepts such as directed and undirected graphs, walks, trails, cycles, and graph isomorphism, along with examples and problems related to finding paths in graphs. Additionally, it discusses subgraphs, complements, and the characteristics of connected and disconnected graphs.

Uploaded by

Dheraj K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views117 pages

module 4 (3)

This document covers Module 4 of a course on Discrete Mathematical Structures, focusing on Graph Theory and its applications. It includes definitions, properties, and concepts such as directed and undirected graphs, walks, trails, cycles, and graph isomorphism, along with examples and problems related to finding paths in graphs. Additionally, it discusses subgraphs, complements, and the characteristics of connected and disconnected graphs.

Uploaded by

Dheraj K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 117

Discrete Mathematical Structures

Course Code: BCS405A


Module 4
TEXT BOOK
Discrete and Combinatorial Mathematics, Ralph P. Grimaldi, 5th Edition,
PHI/Pearson Education, 2004.
Module 4 - Graph Theory and Applications
• Definitions and Examples Sub graphs, Complements
• Graph Isomorphism, Vertex Degree, Euler Trails and Circuits
• Planar Graphs
• Hamilton Paths and Cycles
• Graph Coloring, and Chromatic Polynomials
Directed Graph - Digraph
• Graph G= (V, E), where V be a finite nonempty set, and E ⊆ V X V is called a
directed graph or digraph (on V), where V is the set of vertices, or nodes,
and E is its set of (directed) edges or arcs.
• If G = (V, E) does not concern with the direction, then E is a set of unordered
pairs of elements taken from V, and G is called an undirected graph.
• Whether G = (V, E) is directed or undirected, V is the vertex set of G and E
the edge set of G.
• In the figure, for any edge, such as (b, c), the edge is incident with the
vertices b, c; b is said to be adjacent to c, whereas c is adjacent from b.
• In the edge (b, c), Vertex b is called the origin, or source and vertex c is the
terminus, or terminating vertex.
• The edge (a, a) is a loop, and the vertex e that has no incident edges is
called an isolated vertex.
• An undirected graph shown in Figure 1 is a more compact way of
describing the directed graph given in Figure 2
• In an undirected graph, there are undirected edges such as (a, b), (b, c), (a,
c), (c, d).
• An edge (a, b) stands for ((a, b), (b, a)), Although (a, b) = (b, a) only when
a = b, we do have (a, b) = (b, a) fro any a, b.
• If a graph G when not specified as directed or undirected is by default
considered as directed.
• When there are no loops in the graph
It is called Loop free
Walk
• Let x, y be vertices (not necessarily distinct) in an undirected graph
G = (V, E).
• An x-y walk in G is a (loop-free) finite alternating sequence of vertices and
edges from G, starting at vertex x and ending at vertex y and involving the n
edges ei = { xi_1, xi }, where 1 <= i <= n.

• The length of the walk is n, the number of edges in the walk.


• When n = 0, there are no edges, x = y, and the walk is called trivial.
• Any x-y walk where x = y (and n > 1) is called a closed walk, Otherwise the
walk is called open walk.
• A walk may repeat both vertices and edges.
• For the graph in Figure the following are three open walks and Only the
edges or the vertices only can be listed
1. {a, b}, {b, d}, {d, c}, {c, e}, {e, d}, {d, b}: An a-b walk of length 6 in which
the vertices d and b are repeated, as well as the edge {b, d} (= {d, b}).
And this can also be b-a walk {b, d}, {d, e}, {e, c}, {c, d}, {d, b}, {b, a}
2. b  c  d  e  c  f : A b-f walk of length 5 and the vertex c is repeated,
but no edge appears more than once and also f – b walk of length 5
3. {f, c}, {c, e}, {e, d}, {d, a}: A f-a walk of length 4 with no repetition of
either vertices or edges.
4. The edges {b, c} , {c, d}, {d, b} is a
b – b closed walks.
Special walks
• In an undirected graph G = (V, E).
a) If no edge in the x-y walk is repeated, then the walk is called an x-y trail.
And a closed x-x trail is called a circuit.
b) If no vertex of the x-y walk occurs more than once, then the walk is called
an x-y path. When x = y, the term cycle is used to describe such a closed
path.
• The term cycle implies the presence of at least 3 distinct edges .
a) The b-f walk: b  c  d  e  c  f in figure is a b-f
trail, but it is not a b-f path because of the
repetition of vertex c.
• However, the f-a walk: {f, c}, {c, e}, {e, d}, {d, a} is
both an f-a trail ( of
length 4) and an f-a path (of length 4).
b) In Figure, the edges {a, b}, {b, d}, {d, c}, {c, e}, {e,
d}, and {d, a} provide an a-a circuit. The vertex d is
repeated, so the edges do not give us an a-a cycle.
• c) The edges {a, b}, {b, c}, {c, d}, and (d, a} provide
an a-a cycle (of length 4) . When ordered
appropriately these same edges may also define a b-
b, c-c, or d-d cycle. Each of these cycles is also a
circuit.
Summary
Graph property
• An undirected graph G = (V, E) is connected if there is a path between any
two distinct vertices of G.
• For a directed graph G = (V , E) , its associated undirected graph is the
graph obtained from G by ignoring the directions on the edges.
• If more than one undirected edge results for a pair of distinct vertices in G,
then only one of these edges is drawn in the associated undirected graph.
• G is connected, when this associated graph is connected, else, graph is
called disconnected.
• In the Figure, undirected graph G on
V = {a, b, c, d, e, f, g} is not connected
because, there is no path from a to e.
• However, the graph is composed of pieces
with vertex sets
V1 = {a, b, c, d}, V2 = {e, f, g}, and edge sets
El = {{a, b}, {a, c}, {a, d}, {b, d}},
E2 {{e, f}, {f, g}} that are themselves
connected, and these pieces are called the
(connected) components of the graph
denoted as k(G).
• Hence an undirected graph G = (V, E) is disconnected if and only if V can
be partitioned into at least two subsets V1, V2 such that there is no edge
in E of the form {x, y}, where x ∈ Vi and y ∈ V2. A graph is connected if
and only if it has only one component.
Multigraph
• Let V be a finite nonempty set. The pair
(V, E) determines a multigraph G with
vertex set V and edge set E if, for some x,
y ∈ V, there are two or more edges in E
of the form
a) (x, y) (for a directed multigraph), or
b) {x, y} (for an undirected multigraph).
• Figure shows a directed multigraph.
• There are three edges from a to b, hence, the edge (a, b) has multiplicity 3.
• The edges (b, c) and (d, e) both have multiplicity 2.
• Also, the edge (e, d) and either one of the edges (d, e) form a (directed)
circuit of length 2 in the multigraph.
Problem

Graph vertices: a, b, c, d, e, f, g, h
Edges (from the image):Left square with a diagonal:
Vertices: a, b, c, d
Edges: a–b, a–c, b–c, c-d, b–d
•Connecting edge: b-g
•Right square with a diagonal:
•Vertices: e, f, g, h
•Edges: e–f, e–g, f–g, f–h

Find all simple paths from a to h Count how many of these have length Path: a → b → g → f →h
1) a–b–g–f–h 1) a–b–g–f–h → length 4 Count the edges:
2) a–b–g–e–f–h 2) a–b–g–e–f–h → length 5 ✅
1.a–b → 1 edge
3) a–c–b–g–f–h 3) a–c–b–g–f–h → length 5 ✅
4) a–c–b–g–e–f–h → length 6 2.b–g → 1 edge
4) a–c–b–g–e–f–h
5) a–c-d–b–g–f–h 5) a–c-d–b–g–f–h→ length 6 3.g–f → 1 edge
6) a–c-d–b–g–e–f–h 6) a–c-d–b–g–e–f–h→ length 7 4.f–h → 1 edge
Total valid simple paths from a to h: 6 ✅ Paths of length 5: paths 2, 3 ✅ Total edges = 4
Subgraphs, Complements, Isomorphism
a) What types of substructures are present in a graph?
b) Is it possible to draw two graphs that appear distinct but have the same
underlying structure?
What types of substructures are present in a graph?
In graph theory, a substructure refers to a portion or part of a graph. Here are common types:
1) Subgraph:
• A graph formed from a subset of the vertices and edges of another graph.
• Induced subgraph: Formed by taking a subset of the vertices and all edges between them from
the original graph.
• Spanning subgraph: Includes all the vertices of the original graph but only a subset of the edges.

2) Path:
• A sequence of vertices where each adjacent pair is connected by an edge, and no vertex is
repeated (in a simple path).

3) Cycle:
• A path that starts and ends at the same vertex, with no other vertex repeated.

4)Tree (or forest):


• A connected acyclic subgraph is a tree. A collection of trees is a forest.
Contd...
5)Clique:
• A subset of vertices where every two distinct vertices are connected by an
edge (a complete subgraph).

6)Component:
• A maximal connected subgraph. In an undirected graph, a component includes
all nodes connected to each other.

7) Cut:
• A substructure that partitions the graph into two disjoint subsets, often used
in network flow and connectivity studies.
Is it possible to draw two graphs that appear distinct but have
the same underlying structure?
• Yes, absolutely! These are called isomorphic graphs.

• Graph Isomorphism: Two graphs are isomorphic if there is a one-to-one


correspondence between their vertex sets that preserves adjacency —
meaning, edges connect corresponding vertices in both graphs.

• Why they can look different:


• The layout or drawing of a graph (how it's positioned on paper) doesn't
affect its structure. So two graphs can have different visual representations
(e.g., circular vs. linear layout), yet be structurally identical.
Example
• Example:
• One graph might look like a triangle.

• Another might look like three dots connected in a zigzag.

• But if the connectivity between nodes is the same, they’re isomorphic.


Subgraphs
• If G = (V, E) is a graph (directed or undirected), then G 1 = (V1, E1) is called

incident with vertices in V1. It must have at least one vertex (∅ ∉ V₁ means
a subgraph of G if ∉ ⊆ V1 ⊆ V and E1 ⊆ E, where each edge in E1 is

it's not an empty set).

• Figure provides an undirected graph G and two of its subgraphs, G1 and G2.
• The vertices a, b are isolated in subgraph G1.
• Part (b) of the figure provides a directed graph where vertex w is isolated
in the subgraph G'.
Spanning Subgraph
• Given a (directed or undirected) graph G = (V, E), let G1 = (V1, E1) be a
subgraph of G. If V1 = V, then G1 is called a spanning subgraph of G.
• The subgraphs G3 and G4- shown in part a of Figure below are both
spanning subgraphs of G.
• In part(b) of Figure the directed graphs G" and G"' are two of the 24 = 16
possible spanning subgraphs.
• In part (a) of Figure neither G1 nor G2 is a spanning subgraph of G.
• The directed graph G' in part (b) of Figure is a subgraph, but not a spanning
subgraph, of the directed graph G. A spanning graph (more commonly
called a spanning subgraph) is a subgraph that includes all the vertices of
the original graph, but possibly only some of the edges.
Induced Subgraph
• Let G = (V, E) be a graph (directed or undirected). If ∅∉ U ⊆ V , the
subgraph of G induced by U is the subgraph whose vertex set is U and
which contains all edges (from G) of either the form
a) (x, y), for x, y ∈ U (when G is directed), or
b) {x, y}, for x, y ∈ U (when G is undirected).
• This subgraph is denoted by <U>.

exists ∅ ∉ U ⊆ V , where G' = <U>.


• A subgraph G' of a graph G = (V, E) is called an induced subgraph if there
• Let G = (V, E) denote the graph in Figure
• The subgraphs in parts (b) and (c) of the figure are induced subgraphs of G.
• For the connected subgraph in part (b), G1 = <U1> for U1 = {b, c, d, e}.
• The disconnected subgraph in part (c) is G2 = <U2> for U2 = {a, b, e, f}.
• Finally, G3 in part (d) is a subgraph of G, but not an induced subgraph; the
vertices c, e are in G3, but the edge {c, e} (of G) is not present. – (if G3 was
mentioned as disconnected then it would be induced)
Example
• For the subgraphs in Figure (a), G2 is an induced subgraph of G but the
subgraph G1 is not an induced subgraph because edge {a, d} is missing.
Removal of edges and vertices
• G1 = G – c,  V –c and E – ( {b,c}, {c, d}) G1 = <U1> U1 = {a, b, d, f, g, h}
• G2 = G – {c, d}
• G3 = (G – b) – f = (G – f) – b = <U3> = { a, c, d, g, h}
Complement
• Let G be a loop-free undirected graph on n vertices.
• The complement of G, denoted , is the subgraph of Kn, consisting of the n
vertices in G and all edges that are not in G.
• If G = Kn, is a graph consisting of n vertices and no edges and such a graph
is called a null graph.
• Figure shows an undirected graph on four vertices and its complement is
shown in part (b)
Isomorphism
• Let G1 = ( V1, E1 ) and G2 = (V2, E2) be two undirected graphs.
• A function f : V1  V2 is called a graph isomorphism if
a) f is one-to-one and onto, and
b) for all a, b ∈ V1, {a, b} ∈ E1 if and only if {f (a), f (b)} ∈ E2.
When such a function exists, G1 and G2 are called isomorphic graphs.
• The vertex correspondence of a graph isomorphism preserves adjacencies.
• Since which pairs of vertices are adjacent and which are not is the only
essential property of an undirected graph, in this way the structure of the
graphs is preserved.
• For the graphs in parts (a) and (b) of Figure, the function f defined by f (a) =
w f(b) = x, f(c) = Y, f (d) = z provides an isomorphism.
• Any one-to-one correspondence between {a, b, c, d} and {w, x, y, z} will be
an isomorphism because both of the given graphs are complete graphs.
• This would also be true if each of the given graphs had only four isolated
vertices (and no edges).1
• Consequently, as far as (graph) structure is concerned, these graphs are
considered the same each is (isomorphic to) the complete graph K4.
• For the graphs in parts (c) and (d) of Figure, the function g defined by
g(m) = r, g(n) = s, g(p) = t, g(q) = u is one-to-one and onto (for the given
vertex sets).
• However, although {m, q}, is an edge in the graph of part (c), {g(m), g(q)} =
{r, u} is not an edge in the graph of part (d).
• Consequently, the function g does not define a graph isomorphism.
• To maintain the correspondence of edges, we consider the one-to-one onto
function h where h(m) = s, h(n) = r, h(p) = u, h(q) = t
• In this case we have the edge correspondences
• {m, n} ⇿ {h(m), h(n)} = (s, r}, {n, q} ⇿ {h(n), h(q)} = (r, t},
• {m, p} ⇿ {h(m), h(P)) = {s, u}, {p, q} ⇿ {h(p), h(q)} = {u, t},
• (m, q} ⇿ {h(m), h(q)} = {s , t}, hence h is a graph isomorphism
• However figure a has 6 edges and figure c has 5 edges and hence do not
correspond to isomorphism
• Consider the 2 graphs with
ten vertices
• The correspondence is
shown below
• But, how is the
correspondence
identified?
Summary
• Equal number of vertices.
• Equal number of edges.
• Same degree sequence
• Same number of circuit of particular length
• Sometimes even though two graphs are not isomorphic, their graph
invariants- number of vertices, number of edges, and degrees of vertices all
match. In this case paths and circuits can help differentiate between the
graphs.
• Because an isomorphism
preserves adjacencies, it
preserves graph sub-structures
such as cycles and paths.
• In graph (a) the edges {a, f}, {f, i},
{i, d}, {d, e}, and {e, a} constitute
a cycle of length 5. Hence, try to
find an isomorphism, by
preserving this cycle.

• One possibility for the corresponding edges in graph (b) is {q, w}, {w, z}, {z, y}, {y, r}, and {r,
q}, which also provides a cycle of length 5.
• A second choice is given by the edges in the cycle y  r  s  t  u  y.
• In addition, starting at vertex a in graph (a), we find a path that will "visit" each vertex
only once – a  f  h  c  b  g  j  e  d  i
• For the graphs to be isomorphic there must be a corresponding path in graph (b) – q  w 
tuvxsryz
• Are the 2 isomorphic?
• Adjacency of a and d is 2, adjacency of b and f is 3, adjacency of c and e is 4
• Adjacency of u, x, and z is 2, adjacency of v, w, and y is 4
• Hence not isomorphic
• It can also be checked with cycles, circuits and trails.
Problems
Vertex Degree – Euler Trails and circuits
• Let G be an undirected graph or multigraph. For
each vertex v of G, the degree of v, written deg(v),
is the number of edges in G that are incident with
v.
• A loop at a vertex v is considered as two incident
edges for v.
• For the graph in Figure, deg(b) = deg(d) = deg( f) =
deg(g) = 2, deg(c) = 4, deg(e) = 0, and deg(h) = 1.
• For vertex a, deg(a) = 3 because a loop is counted
twice.
• Since h has degree 1, it is called a pendant vertex.
Theorem(Handshaking Property)
• If G = (V, E) is an undirected graph or multigraph, then ∑v∈V deg(v) = 2|E|.
• Proof:
• As we consider each edge {a, b} in graph G, we find that the edge contributes a count of 1 to each of
deg(a), deg(b), and consequently a count of 2 to ∑v∈V deg(v).
• Thus 2|E| accounts for deg(v), for all v ∈ V, and ∑v∈V deg(v) = 2|E|.
• This theorem provides an insight on odd-degree vertices in a graph
• For any undirected graph or multigraph, the number of vertices of odd degree must be even.
• simple graph: A — B — C
• A has degree 1 (odd),
• B has degree 2 (even),
• C has degree 1 (odd)
• So there are 2 vertices (A and C) with odd degrees, which is an even number.
Theorem

Proof:
Let G=(V,E) be an undirected graph, where: V is the set of vertices and
E is the set of edges
Each edge connects two vertices and thus contributes 2 to the total
sum of degrees of all vertices.
So, ∑v∈V deg(v) = 2|E|.
This means the sum of all vertex degrees is an even number because
it's twice the number of edges.
Contd...
• The sum of an odd number of odd numbers is odd.

• The sum of an even number of odd numbers is even.

• But the total sum is even, so the number of odd-degree vertices must be
even.

The sum of an odd number of odd numbers is odd.

The sum of an even number of odd numbers is even.

But the total sum is even, so the number of odd-degree vertices must be even.
• An undirected graph (or multigraph) where each vertex has the same degree
is called a regular graph.
• If deg(v) = k for all vertices v, then the graph is called k-regular.
• Is it possible to have a 4-regular graph with 10 edges?
• From previous theorem 2|E| = 20 = 4|V|, so we have five vertices of degree 4.
• Figure provides two non-
isomorphic examples that satisfy
the requirements.
• If each vertex has degree 4, with
15 edges in the graph, then 2|
E| = 30 = 4|V|, from which it
follows that no such graph is
possible.
Applications
• Multiprocessor Architecture in parallel processing – Grid or Mesh connectivity between processors for
communication during processing and transfer of intermediate results.
• In parallel processing, multiple processors work together to solve a problem faster by dividing the work.
These processors need to communicate with each other, especially to share data or intermediate results.
• Problem – The distances between pairs of processors get longer and longer as the number of processors
increases
• Solution???
As you add more processors:
• The grid grows larger.
• The distance (in number of hops) between far-apart
processors also increases.
• This leads to longer communication times for data
that needs to move across the grid.
• These delays hurt performance and scalability.
Applications
Euler trails and Euler circuits are not directly used as a solution to the mesh/grid
communication delay problem in multiprocessor architectures, but they do have
applications in related areas of computer science, especially where graph traversal and
optimization are involved.
Euler trails and circuits are used in:

• Routing problems – like finding a path that goes over every road (edge) without
repeating.
• Postman Problems – e.g., a postman wants to deliver mail by walking every street once.
• Circuit Design – tracing wires or designing efficient PCB layouts.
• Network Testing – ensuring every link is tested exactly once.
• DNA Sequencing – reconstructing DNA sequences using Eulerian paths.
Hypercube
• A compromise that weighs the number of edges against the distance
between pair of vertices ( processors) is represented in the regular graph –
Hypercube
• In general, for n>=0, Qn+1 is constructed recursively from two copies of Qn
• In Q4 there are 16 vertices
(processors) and the longest
distance between vertices is 4.

• Contrast this with the grids,


where there are 15 vertices in
part (a) and 16 in part (b)--
yet the longest distance is 6 in
both grids.
Euler Trails and Circuits
• Let G = (V, E) be an undirected graph or multigraph with no isolated
vertices.
• Then G is said to have an Euler circuit if there is a circuit in G that traverses
every edge of the graph exactly once.
• If there is an open trail from a to b in G and this trail traverses each edge in
G exactly once, the trail is called an Euler trail.
In-degree , Out-degree
• Let G = (V, E) be a directed graph or multigraph. For each v ∈ V,
a) The incoming, or in-degree of v is the number of edges in G that are
incident into v, and this is denoted by id(v).
b) The outgoing, or out-degree of v is the number of edges in G that are
incident from v, and this is denoted by od(v).
• For the case where the directed graph or multigraph contains one or more
loops, each loop at a given vertex v contributes a count of 1 to each of id(v)
and od(v).
• Theorem: Let G = (V, E) be a directed graph or multigraph with no isolated
vertices. The graph G has a directed Euler circuit if and only if G is
connected and id(v) = od(v) for all v ∈ V.
To find Euler’s circuit
• Be sure that every vertex in the network has even degree.
• Begin the Euler circuit at any vertex in the network.
• As you choose edges, never use an edge that is the only connection to a part
of the network that you have not already visited.
• Label the edges in the order that you travel them and continue this until
you have travelled along every edge exactly once and you end up at the
starting vertex.
Problem
1. Let V = (000, 001, 010, . . , 110, 111). For each four-bit sequence b1 b2 b3
b4 draw an edge from the element b1 b2 b3 to the element b2b3b4 in V.
(a) Draw the graph G = (V, E) as described.
(b) Find a directed Euler circuit for G.
list OF all 16 edges:
• 4-bit From → To
• 0000000 → 000
• 0001000 → 001
• 0010001 → 010
• 0011001 → 011
• 0100010 → 100
• 0101010 → 101
• 0110011 → 110
• 0111011 → 111
• 1000100 → 000
• 1001100 → 001
• 1010101 → 010
• 1011101 → 011
• 1100110 → 100
• 1101110 → 101
• 1110111 → 110
• 1111111 → 111
• Find a Directed Euler Circuit
• A directed Euler circuit is a closed path that: Starts and ends at the same
vertex.
• Traverses every edge exactly once.
• Conditions for a directed Euler circuit:
• Every vertex's in-degree equals its out-degree.
• The graph is strongly connected (every vertex reachable from every other).
✔️This graph satisfies both:
• Each node has in-degree = 2 and out-degree = 2.
• It’s strongly connected.
• SO a directed Euler circuit exists.
Euler Circuit Example:
Start at 000, follow edges in this order (based on 4-bit strings):
• 0000 → 000 → 000
• 0001 → 000 → 001
• 0010 → 001 → 010
• 0100 → 010 → 100
• 1000 → 100 → 000
• 0001 → already used
• 0011 → 001 → 011
• 0110 → 011 → 110
• 1100 → 110 → 100
• 1001 → 100 → 001
• 0010 → already used
• 0101 → 010 → 101
• 1010 → 101 → 010
• 0111 → 011 → 111
• 1110 → 111 → 110
• 1101 → 110 → 101
• 1011 → 101 → 011
• 1111 → 111 → 111
Planar Graphs
• A graph (or multigraph) G is called planar if G can be drawn in the plane
with its edges intersecting only at vertices of G.
• Such a drawing of G is called an embedding of G in the plane.
• The first is a 3-regular graph, because each vertex has degree 3; it is planar
because no edges intersect except at the vertices.
• In graph (b) ii is a nonplanar graph; the edges {x, z} and {w , y} overlap at a
point other than a vertex. However, it can be redrawn as shown in part (c)
Consequently, K4 is planar.
• As K4 is planar, the graphs K1, K2, and K3 are also planar. ( K4 – is a graph
with 4 vertices, K3 – 3 vertices and so on)
• An attempt to embed K5 in the plane is shown in Figure.
• If K5 were planar, then any embedding would have to contain the pentagon
in part (a) of the figure.
• Since a complete graph contains an edge for every pair of distinct vertices,
we add edge (a, c} as shown in part (b). This edge is contained entirely
within the interior of the pentagon in part (a).
• Moving to part (c), add the edges (a, d), (c, e}, and (b, e).
• Now consider the vertices b and d. The edge {b, d) is required in order to
have K5.
• Vertex d is inside the region formed by the cycle edges {a, c}, {c, e} and {e, a },
whereas b is outside the region.
• Thus in drawing the edge {b, d}, intersection is a must for one of the existing
edges at least once, as shown by the dotted edges in part (d).
• Consequently, K5 is nonplanar.
Bipartite Graph
• A graph G = (V, E) is called bipartite if V = V1 U V2 with V1 ⋂ V2 = ∅
, and every
edge of G is of the form {a, b} with a ∈ V1 and b ∈ V2.
• If each vertex in V1 is joined with every vertex in V2, we have a complete
bipartite graph.
• In this case, if |V1| = m, |V2| = n, the graph is denoted by Km,n
• Figure shows two bipartite graphs. The graph in part (a) satisfies the
definition for V1 = {a, b} and V2 = {c, d, e}.
• If the edges {b, d} and {b, c}, are added the result is the complete bipartite
graph K2,3 , which is planar.
• Graph (b) of the figure is K3,3 . Let V3 = (h1, h2, h3) and V2 = (u1, u2, u3),
and interpret V1 as a set of houses and V2 as a set of utilities.
• Then K3,3 is called the utility graph.
• Can we hook up each of the houses with each of the utilities and avoid
having overlapping utility lines?
• In Figure(b) it appears that this is not possible and that K3,3 is nonplanar.
• (a) Let V1 = {a, d, e, h} and V2 = {b, c, f, g}.

V1 ⋂ V2 = ∅.
• Then every vertex of G is in V1 U V2 and

• Also every edge in G may be written as


{x, y} where x ∈ VI and y ∈ V2.
• Hence, the graph G in part (a) of the
figure is bipartite.
• (b) Let V1' = {a, b, g, h} and V2' = {c, d, e, f}.

V1' ⋂ V2' = ∅.
• Then every vertex of G' is in V1' U V2' and

• Since every edge of G' may be written as


{x, y}, with x ∈ V1' and y ∈ V2', it follows
that this graph is bipartite.
• In fact G' is (isomorphic to) the complete
bipartite graph K4,4.
• (c) This graph is not bipartite.
• If G" = (V", E") were bipartite, let the vertices
of G" be partitioned as V1" U V2", where each
edge in G" is of the form {x, y} with x ∈ V1"
and y ∈ V2".
• We assume vertex a is in V1".
• Now consider the vertices b, c, d, and e. Since
{a, b} and {a, c} are edges of G" we must have
b, c in V2".
• Also, { b, d} is an edge in the graph, so d is in
V1". But then {d, e} ∈ E" ⇒ e ∈ V2“,
while {c, e} ∈ E“ ⇒ e ∈ V1" .
Elementary subdivision and Homeomorphic
• Let G = (V E) be a loop-free undirected graph, where E ≠∅ .
• An elementary subdivision of G results when an edge e = {u, w} is removed
from G and then the edges {u, v}, {v, w} are added to G - e, where v ∉ V.
• The loop-free undirected graphs G1 = (V1, E1) and G2 = ( V2, E2) are called
homeomorphic if they are isomorphic or if they can both be obtained from
the same loop-free undirected graph H by a sequence of elementary
subdivisions.
• a) Let G = (V, E) be a loop-free undirected graph with |E| > 1. If G' is obtained
from G by an elementary subdivision, then the graph G' = (V', E') satisfies |V|
= |V| + 1 and |E| = |E| + 1
• If two graphs are homeomorphic, they are either both planar or both non-
planar
• Consider the graphs G, G1, G2, and G3 in Fig.
• Here G1 is obtained from G by means of one elementary subdivision: Delete edge {a, b}
from G and then add the edges {a, w} and {w, b}.
• G2 is obtained from G by 2 ESs. Hence G1 and G2 are homeomorphic.
• Also, G3 can be obtained from G by 4 ESs, so G3 is homeomorphic to both GI and G2.
• However, G1 cannot be obtained from G2 (or G2 from G1) by a sequence of ESs.
• But, G3 can be obtained from either G1 or G2 by a sequence of ESs: six (such sequences
of three elementary subdivisions) for G1 and two for G2.
• But neither G1 nor G2 can be obtained from G3 by a sequence of ESs.
Finite and Infinite region
• For any planar connected graph Kn there exists maximum of n regions –
• n-1 finite regions (bounded) and 1 infinite region
• In the graph K4, there are 2 finite regions R1, R2, R3 and one infinite region
R4
Dual Graph
• To construct a dual for a planar graph or multigraph G with V = {a, b, c, d, e, f}, place a
point (vertex) inside each region, including the infinite region, determined by the graph,
as in Figure (a).
• For each edge shared by two regions, draw an edge connecting the vertices inside these
regions.
• For an edge that is traversed twice in the closed walk about the edges of one region,
draw a loop at the vertex for this region, as shown in Figure (b), Gd is a dual for G
• From this example we make the following observations:
• 1) An edge in G corresponds with an edge in Gd, and conversely.
• 2) A vertex of degree 2 in G yields a pair of edges in Gd that connect the
same two vertices.
• Hence Gd may be a multigraph. (Here vertex e provides the edges {a, e},
{e, f} in G that brought about the two edges connecting v and z in Gd.)
• 3) Given a loop in G, if the interior of the (finite area) region determined by
the loop contains no other vertex or edge of G, then the loop yields a
pendant vertex in Gd. (It is also true that a pendant vertex in G yields a loop
in Gd.)
• 4) The degree of a vertex in Gd is the number of edges in the boundary of
the closed walk about the region in G that contains that vertex.

Cut-Set
• Let G = (V, E) be an undirected graph or multigraph.
• A subset E' of E is called a cut-set of G if by removing the edges (but not the
vertices) in E' from G, we have k(G) < k(G'), where G' = (V, E - E'); but when
we remove (from E) any proper subset E" of E', we have k(G) = k(G"), for G"
= (V, E - E").
• For a given connected graph, a cut-set is a minimal disconnecting set of edges.
• In the graph in Figure, each of the sets {{a, b}, {a, c}}, {{a, b}, {c, d}}, {{e, h}, {f, h}, {g, h}},
and {{d, f}} is a cut-set.
• For the graph in part (b) of the figure, the edge set {{n, p}, (r, p), {r. s}) is a cut-set.
• Note that the edges in this cut-set are not all incident to some single vertex.
• Here the cut-set separates the vertices m, n, r from the vertices p, s, t.
• The edge set {{s, t}} is also a cut-set for this graph—the removal of the edge {s, t} from
this connected graph results in a subgraph with two components, one of which is the
isolated vertex t.
• Whenever a cut-set for a connected graph consists of only one edge, that edge is called a
bridge for the graph. For the graph in Fig. 11.62(a), the edge {d, f} is the only bridge; the
edge {s, t} is the only bridge in part (b) of the figure.
Bridge
• Whenever a cut-set for a connected graph consists of only one edge, that
edge is called a bridge for the graph.
• For the graph in Figure, the edge {d, f} is the only bridge; the edge {s, t} is
the only bridge in part (b) of the figure.
• a) Show that the graphs in Figure are isomorphic.
• b) Draw a dual for each graph.
• c) Show that the duals obtained in part (b) are not isomorphic.
• d) Two graphs G and H are called 2-isomorphic if one can be obtained from the other by
applying either or both of the following procedures a finite number of times.
• e) For the cut-set ((a, b}, (c, (d, b}} in part (a) of Figure, find the corresponding cycle in
its dual. In the dual of the graph in Figure(b), find the cut-set that corresponds with the
cycle f w , z}, (z, x}, {x, y}, (y, w} in the given graph.
Hamilton Paths and Cycles
• If G = (V, E) is a graph or multigraph with |V|> =3, then, G has a Hamilton
cycle if there is a cycle in G that contains every vertex in V.
• A Hamilton path is a path (and not a cycle) in G that contains each
vertex.
• Given a graph with a Hamilton cycle, deletion of any edge in the cycle
results in a Hamilton path.
• Also, a graph can have a Hamilton path without having a Hamilton cycle.
• If a graph has a Hamilton cycle, then the graph will be connected graph.
• Referring back to the hypercubes in Q2 the cycle 00 10  11 —> 01 00
and in Q3 the cycle 000 100110010011111101001000,
Q2 and Q3 have Hamilton cycles (and paths).
• In fact, for all n >= 2, Qn has a Hamilton cycle.
• If G is the graph in Figure, the edges {a, (b, c}, {c, f}, (f. (e. {d, g}, {g, h}, {h, i} yield a Hamilton
path for G. But does G have a Hamilton cycle?


• Since G has nine vertices, if there is a Hamilton cycle in G it must contain nine edges.
• Start at vertex b and try to build a Hamilton cycle. (Because of the symmetry in the graph, it
doesn't matter whether we go from b to c or to a)
• At c move to, either to f or to i - Using symmetry again, go to f .
• Then delete edge {c, i} from further consideration because it is not possible to return to
vertex c.
• In order to include vertex i in our cycle, we must now go from f to i (to h to g).
• With edges {c, f} and {f, i} in the cycle, cannot have edge {e. f} in the cycle
• But then once reached e, its terminated. Hence there is no Hamilton cycle for the graph.
Hints
• for trying to find a Hamilton cycle in a graph G = (V, E).
1. If G has a Hamilton cycle, then for all v ∈ V, deg(v) >= 2.
2. If a ∈ V and deg(a) = 2, then the two edges incident with vertex a must
appear in every Hamilton cycle for G.
3. If a ∈ V and deg(a) > 2, then in the process of building a Hamilton cycle,
once vertex a is passed through, any unused edges incident with a are
deleted from further consideration.
4. In building a Hamilton cycle for G, a cycle for a subgraph of G cannot be
obtained unless it contains all the vertices of G.
• There exists a Sufficient condition for the existence of a Hamilton Cycle in a
loop-free graph
• Let G = (V, E) be a loop-free undirected graph with |V| = n>= 3.
If deg(x) + deg(y) >= n for all nonadjacent x, y ∈ V, then G contains a
Hamilton cycle.-----ORE’S Theorem
• Let G = (V, E) be a loop-free undirected graph with |V| = n>= 3, and
If deg(v) >= n/2 for all v ∈ V, then G contains a Hamilton cycle.---DIRAC’s
Theorem
Theorem
Find a Hamilton cycle, if one exists, for each of the graphs. If the graph has no
Hamilton cycle, find if it has a Hamilton Path
Example
Contd....
Königsberg bridge problem
• The Königsberg bridge problem is a famous historical problem in
mathematics that led to the foundation of graph theory and topology.
• In the 18th century, the city of Königsberg in Prussia (now Kaliningrad,
Russia) was set on both sides of the Pregel River, with two large islands
connected to each other and the mainland by seven bridges.

• The question was:


Is it possible to take a walk through the city that crosses each of the seven
bridges exactly once and returns to the starting point?
Solution

• Euler’s Solution (1736):


The mathematician Leonhard Euler proved that:
• It is not possible to do so.
• He abstracted the problem by representing landmasses as nodes (vertices)
and bridges as connections (edges) — thus creating the first graph.
Birth of graph theory.
Euler's Key Insight:
• For such a walk to be possible (now called an Eulerian circuit), each node must have an
even number of bridges (even degree).
• In the Königsberg case, all four landmasses had an odd number of bridges — making
the walk impossible. This means that there does not exist a closed walk that contains all
edges exactly once.
Coloring and Chromatic Number

• A coloring of a graph G assigns colors to the vertices of G so that


adjacent vertices are given different colors.
• The minimal number of colors required to color a given graph is
called the chromatic number of a graph.
Example 1: Simple Graph Coloring

Find the chromatic


number of the graph
on the left.
Example 2: Coloring a Wheel

Find the chromatic


number of the graph
on the left.
Answer: 4.
Example 3: Unforced Coloring

Find the chromatic


number of the graph
on the left.
Answer: 4.
Example
Example
Example 4: Committee Scheduling

• There are 10 committees:


• A = {1,2,3,4}
• B = {1,6,7}
• C = {3,4,5}
• D = {2,4,7,8,9,10}
• E = {6,9,12,14}
• F = {5,8,11,13}
• G = {10,11,12,13,15,16}
• H = {14,15,17,19}
• I = {13,16,17,18}
• J = {18,19}
• Model graph with a vertex corresponding to each committee and with
an edge joining two vertices if they represent committees with
overlapping membership.
Contd..
• Each node represents a committee (A–J).

• An edge between two nodes means those committees share at least one
person (i.e., they conflict and cannot meet at the same time).

• This graph can now be used to:

• Determine the minimum number of time slots (chromatic number)

• Create a feasible meeting schedule without double-booking anyone


Example 4: Committee Scheduling
 There are 10 committees:
 A = {1,2,3,4}
 B = {1,6,7}
 C = {3,4,5}
A  D = {2,4,7,8,9,10}
 E = {6,9,12,14}
 F = {5,8,11,13}
B C  G = {10,11,12,13,15,16}
 H = {14,15,17,19}
 I = {13,16,17,18}
D  J = {18,19}

E F
 How many hours are needed?
Each node represents a committee (A–J).
 An edge between two nodes means those committees
G
share at least one person (i.e., they conflict and cannot
meet at the same time).
 Determine the minimum number of time slots
H I
(chromatic number)

J  Create a feasible meeting schedule without double-


booking anyone
Example 4: Committee Scheduling

A  There are 10 committees:


 A = {1,2,3,4}
 B = {1,6,7}
B C  C = {3,4,5}
 D = {2,4,7,8,9,10}
D  E = {6,9,12,14}
 F = {5,8,11,13}
E F  G = {10,11,12,13,15,16}
 H = {14,15,17,19}
G  I = {13,16,17,18}
 J = {18,19}
 How many hours are
H I needed?
 Answer: 4.
J
Radio Frequency Assignment Problem

 In a given teritory there are n


radio stations. Each one is
determined by its position (x,y)
and has a range radius r. The
frequencies should be assigned
in such a way that no two radio
stations with overlaping hearing
ranges are assigned the same
frequency and that the total
number of frequencies is
minimal.
Radio Frequency Assignment
Problem - Solution
 The problem is modeled by a
graph G. Vertices of G are the
circles centered at (x,y) with
radius r. Two vertices are
adjacent if the areas of the
corresponding circles intersect.
 Frequencies are the colors.
 We are looking for an optimal
coloring of G. The minimal
number of frequencies is the
chromatic number of G..
a) Example:
Let G be a graph of 3 isolated vertices and
λ=2 colors. Then:
P(G,2)= 2^3 =8
All 8 possible combinations of colorings are
valid since no edges exist to impose
constraints.

meaning we’re choosing 𝑛distinct colors


b) Example: This is the falling factorial,

from λ options.
If λ<n, then P(Kn,λ)=0---not enough colors
to color all vertices differently.
For K3, the triangle graph, and λ=3:
P(K3,3)=3⋅2⋅1=6
so P(G,λ)=λ^2 (λ−1)^2
Summary
The Chromatic Polynomial Pk(G).
• The chromatic polynomial Pk(G) gives a formula for the
number of ways to properly color G with k colors. The
formula is polynomial in k.
Example 7: Chromatic Polynomial – Complete Graph Kn.
• Let us consider K4. Obviously
• P1(K4) = 0
• P2(K4) = 0
• P3(K4) = 0
• P4(K4) = 4.3.2.1
• P5(K4) = 5.4.3.2
• P6(K4) = 6.5.4.3
• P7(K4) = 7.6.5.4
• In general:
• Pk(K4) = k.(k-1)(k-2).(k-3)
• More generally:
• Pk(Kn) = k.(k-1).(k-2) ... (k – n+1)
• This is because:
• First vertex: k choices
• Second vertex: k−1 choices (must differ from the first)
• Third vertex: 𝑘−2
• Fourth vertex: 𝑘−3
The Chromatic Polynomial Pk(G).
• The chromatic polynomial Pk(G) gives a formula for the
number of ways to properly color G with k colors. The
formula is polynomial in k.
Example 7: Chromatic Polynomial – Complete Graph Kn.
• Let us consider K4. Obviously
• P1(K4) = 0
• P2(K4) = 0
• P3(K4) = 0
• P4(K4) = 4.3.2.1
• P5(K4) = 5.4.3.2
• P6(K4) = 6.5.4.3
• P7(K4) = 7.6.5.4
• In general:
• Pk(K4) = k.(k-1)(k-2).(k-3)
• More generally:
• Pk(Kn) = k.(k-1).(k-2) ... (k – n+1)
• This is because:
• First vertex: k choices
• Second vertex: k−1 choices (must differ from the first)
• Third vertex: 𝑘−2
• Fourth vertex: 𝑘−3
Chromatic Polynomial – Circuit C4.
Pk(C4) = k(k-1)2 + k(k-1)(k-2)2.
There are two kinds of proper colorings of C4 :
Case 1: Opposite vertices get the same color
•Think of the square: A–B–C–D–A

•Suppose vertex A = C (same color), and B = D (same color), and all adjacent
vertices are different. This can only happen if you use exactly 2 colors,
alternating
•Number of such colorings: k(k−1)
But there are multiple ways this can happen.
So the total number of 2-colorings of C4 is:k(k-1)2
Case 2: All 4 vertices use 3 or more distinct colors
Now we use more than 2 colors, so that all adjacent vertices are different
and not opposite. This more general case yields:k(k-1)(k-2)2
✅ Total Chromatic Polynomial:
So, putting both cases together:Pk(C4)=k(k-1)2 + k(k-1)(k-2)2
Example: Triangle Graph K3
Let:

•G=K3: a triangle with 3


vertices: a,b,c and 3 edges:
ab,bc,ca

•Let’s pick edge e=ab


P(G,λ)=P(G−e,λ)−P(G/e,λ)
Where:

•G−e: graph with edge e removed

•G/e: graph with edge e


contracted (i.e., its endpoints
merged into one)

You might also like