0% found this document useful (0 votes)
81 views9 pages

5.2 Graph Theory

Graph Theory

Uploaded by

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

5.2 Graph Theory

Graph Theory

Uploaded by

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

Topic 5.2.

Special Types of Graphs

1. Complete Graphs –
• A complete graph on n vertices, denoted by Kn, is the simple graph that contains exactly
one edge between each pair of distinct vertices.
• Every node is connected to all other nodes. Degree of any node= n-1

• In this above figure all the graphs K1, K2, K3, K4, K5, K6 are complete graphs.
• No. of edges of Kn = n(n-1)/2. Sum of 1+2+....+(n-1)

2. Cycle Graphs / Cycles –


• For any n3, a cycle on n vertices, Cn, is a simple graph where V={v1,v2,… ,vn} and
E={{v1,v2},{v2,v3},…,{vn−1,vn},{vn,v1}}.
• Only one simple cycle or circuit.

• C3, C4, C5, C6 are cycles.


• No. of edges of Cn = n.

3. Wheels –
• A wheel Wn is obtained by adding an additional vertex to a cycle Cn for n ≥ 3 and
connecting this new vertex to each of the n vertices in Cn by new edges.
• Cycle with one additional vertex that is adjacent to all other.

• W3, W 4, W5, W6 are all wheels.


• No. of edges of Wn = 2n.

n(for cycle)+n(for center)=2n


4. Walk. Paths / Path Graphs –
• Walk: A walk is a sequence of vertices and edges of a graph i.e. if we traverse a graph
then we get a walk. In a walk, both vertex and edges may repeat.
• Open walk: Starting and ending vertices are different.
• Closed walk/ cycle/ circuit: Starting and ending vertices are same.
• Trail: Trail is used to denote a walk with no repeated edge.
• Path: Vertices and edges are visited only once.
Almost Same, But path is a subset of trail

Length=(Total Number of visited Vertices - 1)


• In this graph, few examples of walk are-
o A, B, C, E, D (Length = 4): open walk, trail.
o A, C, B, D, E, C, A (Length = 6): closed walk.
• Path/ non-path:
o A, B, C: Path
o A, B, C, E, D: Path
o A, C, B, D, E, C, A: non-path
• Every path is a walk, not every walk is a path.
• Closed walk is not a path. (Because the Starting point and Finishing point are the same which will be visited twice)

5. Bipartite Graphs –
• A simple graph G is bipartite if V can be partitioned into two disjoint subsets V1 and V2
such that every edge connects a vertex in V1 and a vertex in V2. In other words, there are
no edges which connect two vertices in V1 or in V2.
• In short-
o It consists of two sets of vertices V1 and V2.
o The vertices of set V1 join only with the vertices of set V2.
o The vertices within the same set do not join.
• To determine whether a given graph is bipartite or not, coloring alternate vertex with the
same color may be applied. If number of color used is 2, then Bipartite
• Here,
o The vertices of the graph can be decomposed into two sets.
o The two sets are V1 = {A, C} and V2 = {B, D}.
o The vertices of set V1 join only with the vertices of set V2 and vice-versa.
o The vertices within the same set do not join.
o Therefore, it is a bipartite graph.

Complete Bipartite Graphs –


• A bipartite graph where every vertex of set V1 is joined to every vertex of set V2.
• In other words, complete bipartite graph is a bipartite graph which is complete.
• Represented by Km,n.

• Here,
o This graph is a bipartite graph as well as a complete graph.
o Therefore, it is a complete bipartite graph.
o This graph is represented as K4,3.
o No. of edges in complete bipartite graph, Km,n = m*n.

6. Planar Graph –
• In graph theory, planar graph is a graph that can be drawn in a plane such that none of its
edges cross each other i.e. plane without intersecting or overlapping edges.
• Here,
o In this graph, no two edges cross each other.
o Therefore, it is a planar graph.

Graph Coloring/ Chromatic Number –


• ᵧ
The chromatic number, (G), of a graph G is the smallest number of colors for V(G) so
that adjacent vertices are colored differently.
That means must be connected

S => Star

• Chromatic Number of any planar graph is always less than or equal to 4.


• Chromatic Number of any Bipartite graph is 2

7. Konigsberg Bridge Problem –


• Konigsberg is the former name of a German city that is now in Russia.
• The following picture shows the inner city of Konigsberg with the river Pregel.
• The river Pregel divides the city into four land areas A, B, C and D.
• In order to travel from one part of the city to another, there exists seven bridges.
• Konigsberg Bridge Problem may be stated as-
“Starting from any of the four land areas A, B, C, D, is it possible to cross each of the
seven bridges exactly once and come back to the starting point without swimming across
the river?”
• A Swiss Mathematician Leonhard Euler solved this problem.
• He provided a solution to the problem and finally concluded that such a walk is not
possible

8. Euler Graph –
• Any connected graph is called as a Euler Graph if and only if all its vertices are of even
degree.
• In other word, an Euler Graph is a connected graph that contains an Euler Circuit. An
Euler circuit is a circuit that uses every edge of a graph exactly once.
• There exist one closed walk consisting of all vertices in the graph.

• Here,
o This graph is a connected graph and all its vertices are of even degree. Therefore,
it is an Euler graph.
o Alternatively, the above graph contains an Euler circuit BACEDCB, so it is an
Euler graph.

9. Hamiltonian Circuit –
• A closed walk that traverse every vertex of a graph exactly once, except of the starting
and ending vertices. which is the same point

• Here,
o AEHDCGFBA → Hamiltonian Circuit.
o ADCGHEFBA → Hamiltonian Circuit.
10. Graph Representation –
• Adjacency Lists:
o A table with 1 row per vertex, listing its adjacent vertices.

Vertex Adjacent Vertices


A B, E
B A, C, E
C B, D
D C, E
E A, B, D

• Adjacency Matrix:
o The elements of the matrix indicate whether pairs of vertices are adjacent or not in
the graph.
1 - are adjacent
0 - aren't adjacent
A B C D E
A 0 1 0 0 1
B 1 0 1 0 1
C 0 1 0 1 0
D 0 0 1 0 1
E 1 1 0 1 0

• Incidence Matrix: 1 - the vertex and the edge is connected


based on vertices and edges 0 - the vertex and the edge is not connected
11.Trees
T1, T2, T3, T4[a], T4[b], T5[a], T5[b], T5[c], …
Caterpillar, Christmas Tree, …
✓ A tree is a simple graph with no circuits / cycles.
✓ Properties of trees:
• Tn has n-1 edges;
• There exists a unique path between any two vertices;
• Deleting an edge results in a disconnected graph, which is a ‘Forest’ with exactly
two trees;
• A new edge between any two vertices results in a graph with one circuit.

❖ Rooted Trees

1
Level 0
• Parent-child: 1-2, 1-3, 1-4, …
• Ancestor of 16 : 13, 6, 3, 1
2 3 4 Level 1 • Root: 1; Taken to have no
ancestors;
• Descendent of 4: 9, 10, 14, 15
5 6 10 Level 2
7 8 9 • Descendent of 1: 2-17
= • Siblings: 2, 3, 4; 6, 7, 8; 9, 10;
11 Level 3 …
13
12 14 15
Level 4
16 17

▪ Leaves; Internal vertices; Branching factor: 3; Binary trees; Ordered (left to right) Children or
subtrees.

❖ Spanning Trees

• V(S2) = V(S1),
E(S2)  E(S1) and S2 is a tree

• S2 is a spanning tree of graph S1

S1 S2 • S3: Weighted graph

• S4: Possibly a minimum-weight


5 spanning tree of graph S3
5
2
2 7
4 5
6 4 5
3 4
3 4
S3 S4

• Various algorithms are there to obtain a minimum-weight spanning tree.

6) Bipartite Graphs
Example 1:
Say, a, b, c – students; B, E, M, S, H – courses.
Each student takes every course.
3+5 = 8 vertices
• A partition of V contains 2 sets, where no
two elements of the same set are adjacent to
each other.
• K3,5 : Complete bipartite; |E| = (5x3+3x5)/2 =
3x5.
• To determine whether a given graph is
bipartite or not, coloring alternate vertex
with the same color may be applied.
Example 2:
3 concentric rectangles, having the corners of
one connected to the corresponding corners of
inner rectangles.
• After coloring, it is found that a partition of V
contains 2 sets, where no two elements of
the same set are adjacent to each other.
• Bipartite, but not complete.

7) Regular graphs

P2 / T2 C3 / K3 C4 K4 K2,2 K3,3 …

• All the vertices are of the same degree;


• Degree = m, Vertices = n : m-regular with n vertices, Rm,n; |E| = m x n / 2;
m or n must be even!

8) Planar graphs
Examples:
• Tetrahedron – 4 faces, including an infinite face
• Cube – 6 faces
• C3 – 2 faces
• Any tree – 1 face
✓ Can be drawn on a 2-D plane with crossing at a vertex only.
✓ Euler’s formula for planar graphs: e = v+f-2
9) Eulerian Graphs

✓ Eulerian circuit / cycle: Round tour / trail / walk that takes every edge once, and visits all the
vertices.
o Degree of each vertex needs to be even.
✓ Semi-Eulerian: The circuit is not complete, although each edge taken.

10) Hamiltonian Graps


Hamiltonian circuit / cycle:
✓ Round Tour that takes each vertex once.

✓ Semi-Hamiltonian: Cycle not complete, although each vertex visited.

You might also like