0% found this document useful (0 votes)
46 views

Intro To Graph Theory

This document provides an introduction to graph theory and its applications in computer science. It defines graph theory as a branch of mathematics dealing with graphs, which are mathematical structures used to model pairwise relations between objects. Graph theory aims to understand properties of graphs like connectivity and has provided a framework for solving problems in networks, optimization, and other fields. The document then gives a brief history of graph theory, highlighting seminal works like Euler's solution to the Seven Bridges of Königsberg problem in the 18th century and later contributions defining Eulerian and Hamiltonian graphs.

Uploaded by

diomeansgod21
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Intro To Graph Theory

This document provides an introduction to graph theory and its applications in computer science. It defines graph theory as a branch of mathematics dealing with graphs, which are mathematical structures used to model pairwise relations between objects. Graph theory aims to understand properties of graphs like connectivity and has provided a framework for solving problems in networks, optimization, and other fields. The document then gives a brief history of graph theory, highlighting seminal works like Euler's solution to the Seven Bridges of Königsberg problem in the 18th century and later contributions defining Eulerian and Hamiltonian graphs.

Uploaded by

diomeansgod21
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction to Graph Theory:

Fundamentals and Applications in Computer Science

Objective:
To introduce students to the fundamental concepts of graph theory
and its applications in computer science.

Definition of Graph Theory


 Graph theory is a branch of mathematics that deals with the study of
graphs, which are mathematical structures used to model pairwise relations
between objects. A graph consists of two main components: vertices (also
called nodes) and edges.

 Vertices represent the objects, entities, or points in the graph, while


edges represent the connections or relationships between these objects.
Graphs can be used to represent a wide variety of real-world situations,
including social networks, transportation networks, communication
networks, biological networks, and more.

 Graph theory aims to understand various properties and characteristics of


graphs, such as connectivity, paths, cycles, degrees of vertices, planarity,
colorability, and many others. It provides a framework for solving problems
related to networks, optimization, scheduling, routing, and numerous
other applications across different fields, including computer science,
operations research, physics, biology, and sociology.

 The study of graph theory involves exploring different types of graphs, such
as directed graphs (where edges have a specific direction), undirected
graphs (where edges have no direction), weighted graphs (where edges
have weights or costs associated with them), and many other specialized
graph structures. Algorithms and techniques developed in graph theory have
significant practical implications and are widely used in designing efficient
algorithms for various computational problems.
.
History of Graph Theory
The history of graph theory dates back to the 18th century, but its modern
development began in the 19th century and has continued to evolve up to the
present day.

Here's an overview of key milestones in the history of graph theory:


1. Euler's (oy·lr) Seven Bridges of Königsberg problem is a famous problem
in graph theory, proposed by the Swiss mathematician Leonhard Euler in
1736. Königsberg (now Kaliningrad, Russia) was a city that spanned both
sides of the Pregel River, and it contained two large islands connected to
each other and the mainland by seven bridges.

 The problem posed was whether it was possible to take a walk through the
city of Königsberg, crossing each of the seven bridges exactly once, and
returning to the starting point.

 Euler approached the problem by abstracting the city's layout into a graph,
with each landmass represented as a vertex and each bridge as an edge
connecting the corresponding vertices.

 Key points of Euler's solution to the Seven Bridges of Königsberg problem


are:
1. Abstraction into a Graph: Euler transformed the physical layout of the
city into a mathematical abstraction, a graph. This abstraction allowed him
to analyze the problem using graph theory.

2. Identification of Vertices and Edges: Euler identified the landmasses


(islands and mainland) as vertices of the graph and the bridges as edges
connecting these vertices.

3. Eulerian Paths and Circuits: Euler proved that in order for a path (or
circuit) to cross each edge of a graph exactly once, the graph must meet
certain criteria. Specifically, for such a path or circuit to exist, there should
be at most two vertices with an odd degree (an odd number of edges
connected to them). In the case of the Königsberg bridges, each
landmass had an odd number of bridges connecting to it (each with an
odd degree), making it impossible to traverse all bridges exactly once and
return to the starting point.

4. Conclusion: Euler concluded that it was not possible to find a path


crossing each of the seven bridges exactly once and returning to the
starting point. This solution laid the foundation for graph theory and
marked the beginning of the field.

 There are four areas of the town - on the mainland north of the river, on
the mainland south of the river, on the island and on the peninsula (the
piece of land on the right).
 To "visit each part of the town", visit points A, B, C, and D, and cross each
bridge (a, b, c, d, e, f and g) just once.
 So instead of taking long walks through the town, simply draw lines with
a pencil.

The solution to the Seven Bridges of Königsberg problem demonstrated the


power of abstract mathematical reasoning and laid the groundwork for the
development of graph theory, a branch of mathematics with widespread
applications in computer science, operations research, and various other
fields.

2. Eulerian and Hamiltonian Graphs (18th and 19th centuries). Euler


continued his work on graphs, defining Eulerian graphs (graphs where one
can traverse every edge exactly once) and Hamiltonian graphs (graphs
containing a Hamiltonian cycle, a cycle that visits every vertex exactly once).
These concepts became fundamental in the study of graph theory.

 Leonhard Euler (1707–1783) was a Swiss mathematician, physicist,


astronomer, logician, and engineer who made significant contributions to
various fields of mathematics and science. He is considered one of the
greatest mathematicians of all time and is known for his prolific output (refers
to a significant amount of work produced by an individual or a group within a
certain field or domain. When someone is described as having a prolific
output, it means they consistently produce a large volume of work, such as
research papers, books, artistic creations, or any other form of creative or
intellectual output) and wide-ranging work.

 Some of Euler's most notable contributions include:


1. Number Theory: Euler made significant contributions to number theory,
including his work on modular arithmetic, quadratic residues, and the
study of perfect numbers.

2. Analysis: He contributed extensively to the development of calculus,


particularly differential calculus. Euler introduced many concepts and
techniques, including the use of functions, and made important advances
in the theory of infinite series.

3. Graph Theory: Euler is considered one of the founders of graph theory.


His solution to the Seven Bridges of Königsberg problem in 1736 is often
regarded as the first theorem in the field of graph theory and laid the
groundwork for the study of networks and connectivity.
4. Mechanics and Physics: Euler made significant contributions to
mechanics and physics, including his work on fluid dynamics, elasticity
theory, and celestial mechanics. He formulated the Euler–Lagrange
equations, which are fundamental to the calculus of variations.

5. Mathematical Notation and Terminology: Euler introduced many


mathematical notations and terminologies that are still in use today,
including the notation for trigonometric functions (sin, cos, tan), the
symbol for the imaginary unit (i), and the use of the Greek letter π for the
ratio of the circumference of a circle to its diameter.

Euler's work had a profound impact on mathematics and science, and his
influence can be seen in many areas of modern mathematics and physics.
He wrote over 800 books and papers during his lifetime, making him one of
the most prolific mathematicians in history. His contributions continue to be
studied and admired by mathematicians and scientists around the world.

 William Rowan Hamilton (1805–1865) was an Irish mathematician and


physicist who made significant contributions to various fields, including
algebra, geometry, and optics. He is best known for his work in classical
mechanics and his discovery of quaternions, a non-commutative extension
of complex numbers, which have applications in many areas of mathematics
and physics.

 Here are some key aspects of Hamilton's contributions:


1. Quaternions: Hamilton's most famous contribution is his discovery of
quaternions in 1843. Quaternions are a four-dimensional extension of
complex numbers, introduced by Hamilton as a way to represent rotations
in three-dimensional space. They find applications in computer graphics,
robotics, quantum mechanics, and other fields.

2. Mathematical Physics: Hamilton made significant contributions to


mathematical physics, particularly in the study of optics and dynamics.
His work on optics included the development of the theory of systems of
rays, which laid the foundation for modern geometrical optics.
3. Hamiltonian Mechanics: Hamilton formulated the principle of least
action and developed Hamiltonian mechanics, a reformulation of classical
mechanics based on the concept of Hamiltonian functions. His work in
this area provided a powerful mathematical framework for describing the
motion of particles and systems in classical mechanics.

4. Algebra and Geometry: Hamilton made important contributions to


algebra and geometry, including his work on matrices, determinants, and
algebraic geometry. He also introduced the term "scalar" and "vector" into
mathematical language.

5. Research and Publications: Hamilton was a prolific researcher and


published numerous papers and books throughout his career. He was
also involved in editing and publishing mathematical journals and
contributed to the dissemination of mathematical knowledge.

Hamilton's work had a profound impact on mathematics and physics, and his
contributions continue to be studied and applied in various areas of science and
engineering. He is considered one of the greatest mathematicians of the 19th
century, and his legacy is celebrated in the fields of mathematics, physics, and
engineering.

 Leonhard Euler and William Rowan Hamilton were both renowned


mathematicians who made significant contributions to various fields of
mathematics and physics. While they lived in different centuries and
specialized in different areas of mathematics, there are several similarities
and differences between them:

SIMILARITIES
Both Euler and Hamilton were incredibly prolific
Prolific Output mathematicians who produced a vast amount of
work throughout their lifetimes. They each published
numerous papers and books on a wide range of
topics in mathematics and physics.
Both Euler and Hamilton made foundational
contributions to their respective fields. Euler's work
laid the groundwork for many areas of modern
mathematics, including analysis, number theory,
Foundational
and graph theory. Hamilton's discovery of
Contributions
quaternions revolutionized the way rotations are
represented in mathematics and has applications in
many fields, including computer graphics and
robotics.
Both Euler and Hamilton made contributions that
span multiple disciplines. Euler's work extended into
Interdisciplinary
physics, astronomy, and engineering, while
Contributions
Hamilton's contributions included mathematical
physics, optics, and mechanics.
Both mathematicians introduced important
mathematical notations and terminologies that are
still in use today. Euler, for example, introduced the
Mathematical notation for trigonometric functions (sin, cos, tan)
Notation and the use of the letter "e" for the base of the
natural logarithm. Hamilton introduced the term
"scalar" and "vector" into mathematical language
and developed notation for quaternions.
DIFFERENCES
Euler lived in the 18th century, while Hamilton lived
in the 19th century. They were separated by about a
Time Period century, and their work reflects the mathematical
developments and scientific advancements of their
respective time periods.
While both Euler and Hamilton made contributions
across various fields of mathematics and physics,
Areas of
they had different areas of specialization. Euler is
Specialization
best known for his work in analysis, number theory,
and graph theory, while Hamilton is renowned for his
contributions to algebra, geometry, and
mathematical physics.
Euler is known for Euler's formula, Euler's identity,
and his solution to the Seven Bridges of Königsberg
Notable problem, among many other achievements.
Discoveries Hamilton is primarily remembered for his discovery
of quaternions and his work on Hamiltonian
mechanics and optics.
Euler and Hamilton employed different
mathematical techniques in their work. Euler made
Mathematical extensive use of calculus, infinite series, and
Techniques combinatorial methods, while Hamilton's work often
involved algebraic and geometric reasoning, as well
as differential equations.

 In summary, while Euler and Hamilton shared some similarities in their


prolific output, foundational contributions, and interdisciplinary interests, they
also had differences in their areas of specialization, time periods, notable
discoveries, and mathematical techniques. Despite these differences, both
mathematicians left an indelible mark on the history of mathematics and
continue to be celebrated for their groundbreaking work.

3. The Four-Color Theorem (19th century). The four-color theorem, which


states that any map on a plane can be colored with at most four colors in
such a way that no two adjacent regions have the same color, generated
significant interest in graph theory during the 19th century. Although the
theorem was famously proven in the 20th century, its investigation
contributed to the development of graph theory.

4. Planarity and Graph Coloring (19th and 20th centuries). The study of
planar graphs (graphs that can be drawn on a plane without edges crossing)
and graph coloring (assigning colors to vertices or edges subject to certain
constraints) became major areas of research in the late 19th and early 20th
centuries. These topics have applications in map coloring, scheduling, and
optimization.
5. Network Theory (20th century). In the 20th century, graph theory found
widespread applications in network theory, particularly in the analysis of
communication networks, electrical circuits, transportation networks, and
social networks. Graph theory provided valuable tools for modeling,
analyzing, and optimizing complex systems.

6. Algorithms and Computational Graph Theory (20th and 21st centuries).


With the advent of computers, graph theory became increasingly important
in the development of algorithms for solving various computational problems.
Researchers developed efficient algorithms for tasks such as shortest path
finding, maximum flow, matching, and graph traversal. Computational graph
theory continues to be a vibrant area of research today, with applications in
computer science, operations research, and related fields.

Throughout its history, graph theory has evolved into a rich and diverse field
with connections to numerous other areas of mathematics and science. Its
concepts and techniques have found applications in a wide range of disciplines,
making it an indispensable tool for understanding and solving problems in
diverse real-world contexts.
EULER GRAPHS
Euler graphs, Euler paths, and Euler circuits are concepts in graph theory that
relate to the connectivity and traversal of edges in a graph.

EULER GRAPH EULER PATH EULER CIRCUIT


A Euler graph is a A Euler path is a path in a A Euler circuit is a closed
connected graph where graph that traverses path that traverses every
every vertex has an even every edge exactly once. edge exactly once and
degree. starts and ends at the
same vertex.
In Euler graph, it's Unlike Euler circuit, Euler Euler circuits exist in
possible to trace every path does not necessarily Euler graphs, which are
edge exactly once, start and end at the same graphs where every
starting and ending at the vertex. vertex has an even
same vertex. degree.
Euler graphs always Euler paths exist in In Euler circuit, every
have a Euler circuit. graphs where exactly two vertex is visited exactly
vertices have an odd once.
degree; one vertex
serves as the starting
point, and the other as
the ending point.
Example: Consider a Example: In the graph A Example: Consider a
graph with vertices A, B,  B  C  D  E, graph with vertices P, Q,
C, D, E, and F, where where each vertex is R, S, T, U, and V, where
every vertex is connected connected by directed each vertex is connected
to every other vertex. edges, this graph has an to every other vertex.
This graph is an Euler Euler path because This graph has an Euler
graph because each vertices A and E have an circuit because every
vertex has an even odd degree. vertex has an even
degree. degree, allowing for a
closed traversal of edges
starting and ending at the
same vertex.
In summary, Euler graphs have Euler circuits, Euler paths can exist in graphs
with exactly two vertices of odd degree, and Euler circuits are closed paths that
traverse every edge exactly once, starting and ending at the same vertex.
HAMILTONIAN CYCLE
A Hamiltonian path and a Hamiltonian cycle are concepts in graph theory that
relate to traversing vertices rather than edges, unlike Eulerian paths and cycles.

HAMILTON PATH HAMILTON CYCLE


A Hamiltonian path is a path in a graph A Hamiltonian cycle, also known as a
that visits every vertex exactly once. Hamiltonian circuit, is a cycle in a graph
that visits every vertex exactly once
and returns to the starting vertex.

A Hamiltonian path focuses on visiting A Hamiltonian cycle focuses on visiting


each vertex exactly once. each vertex exactly once, but it forms a
closed loop by returning to the starting
vertex.

A Hamiltonian path does not need to Finding a Hamiltonian cycle is also an


start and end at the same vertex. NP-complete problem.

Example: In a graph with vertices A, B, Example: In a graph with vertices A, B,


C, and D, a Hamiltonian path would be C, and D, a Hamiltonian cycle would be
a path that visits each vertex exactly a cycle that visits each vertex exactly
once, such as A  B  C  D. once and returns to the starting vertex,
such as A  B  C  D  A.
In summary, Hamiltonian paths and cycles focus on traversing vertices in a
graph, with a Hamiltonian path visiting each vertex exactly once, while a
Hamiltonian cycle forms a closed loop by returning to the starting vertex after
visiting each vertex exactly once.
Applications of Graph Theory
Graph theory has numerous applications across various fields due to its ability to
model and analyze relationships between objects or entities.

Some of the key applications of graph theory include:


1. Network Analysis: Graph theory is widely used in the analysis of networks,
including social networks, communication networks, transportation
networks, and biological networks. It helps in understanding the structure,
connectivity, and dynamics of these networks, as well as identifying
important nodes and patterns of interaction.

2. Computer Science: Graph theory plays a crucial role in computer science,


particularly in the design and analysis of algorithms. Many problems in
computer science, such as shortest path finding, network flow optimization,
matching, clustering, and graph traversal, can be formulated and solved
using graph-theoretical concepts and techniques.

3. Operations Research: Graph theory is applied in operations research to


model and solve various optimization problems, such as the traveling
salesman problem, vehicle routing problem, facility location problem, and job
scheduling problem. Graph-based algorithms are used to find efficient
solutions to these problems in areas like logistics, supply chain
management, and resource allocation.

4. Circuit Design: Graph theory is used in the design and analysis of electronic
circuits, where circuits are often represented as graphs with components as
vertices and connections as edges. Graph algorithms help in optimizing
circuit layouts, minimizing power consumption, and analyzing circuit
behavior.

5. Bioinformatics: Graph theory is applied in bioinformatics to model and


analyze biological systems, such as genetic networks, protein-protein
interaction networks, and metabolic pathways. Graph-based methods are
used to understand the structure and function of biological molecules and to
identify patterns and relationships within complex biological data.
6. Social Sciences: Graph theory is used in the social sciences to study social
networks, collaboration networks, and communication patterns. It helps in
analyzing the spread of information, influence, and diseases within social
networks, as well as identifying key actors and communities within these
networks.

7. Geography and Cartography: Graph theory is applied in geography and


cartography to model and analyze spatial networks, such as road networks,
transportation networks, and utility networks. It helps in route planning, map
coloring, and geographical analysis.

8. Chemistry: Graph theory is used in chemistry to model molecular structures,


chemical reactions, and molecular interactions. Graph-based methods are
used to analyze the topology of chemical compounds, predict molecular
properties, and design new drugs and materials.

These are just a few examples of the wide-ranging applications of graph theory.
Its versatility and effectiveness in modeling and analyzing complex systems make
it a valuable tool across numerous disciplines.

Definition of Graph
In mathematics and computer science, a graph is a collection of vertices (also
known as nodes) and edges that connect pairs of vertices. Formally, a graph G is
defined as a pair (V, E), where V is a set of vertices and E is a set of edges.

 Vertices: These are the fundamental units of a graph, representing points or


objects. Vertices can represent any entity or concept depending on the
context of the graph. For example, in a social network graph, vertices might
represent people, while in a transportation network, they might represent
cities or intersections.

 Edges: These are the connections between vertices. Each edge connects
two vertices and can have associated properties, such as weight,
directionality, or type. In an undirected graph, edges have no direction and
simply indicate a connection between two vertices. In a directed graph (also
known as a digraph), edges have a direction, indicating a one-way
connection from one vertex to another.

A graph is a diagram of points and lines connected to the points. It has at least one
line joining a set of two vertices with no vertex connecting itself. The concept of
graphs in graph theory stands up on some basic terms such as point, line, vertex,
edge, degree of vertices, properties of graphs, etc.

 Point
A point is a particular position in a one-dimensional, two-dimensional, or
three-dimensional space. For better understanding, a point can be denoted
by an alphabet. It can be represented with a dot.

Example

Here, the dot is a point named ‘a’.


 Line
A Line is a connection between two points. It can be represented with a solid
line.

Example

Here, ‘a’ and ‘b’ are the points.


The link between these two points is called a line.

 Vertex
A vertex is a point where multiple lines meet. It is also called a node. Similar
to points, a vertex is also denoted by an alphabet.

Example

Here, the vertex is named with an alphabet ‘a’.


 Edge
An edge is the mathematical term for a line that connects two vertices. Many
edges can be formed from a single vertex. Without a vertex, an edge cannot
be formed. There must be a starting vertex and an ending vertex for an edge.

Example

Here, ‘a’ and ‘b’ are the two vertices and


the link between them is called an edge.

 Graph
A graph ‘G’ is defined as G = (V, E) Where V is a set of all vertices and E is
a set of all edges in the graph.

Example 1

In the above example, ab, ac, cd, and bd are the edges of the graph.
Similarly, a, b, c, and d are the vertices of the graph.

Example 2

In this graph, there are four vertices a, b, c, and d, and four edges ab, ac,
ad, and cd.
 Loop
In a graph, if an edge is drawn from vertex to itself, it is called a loop.

Example 1

In the above graph, V is a vertex for which it has an edge (V, V) forming a
loop.

Example 2

In this graph, there are two loops which are formed at vertex a, and vertex b.

Degree of Vertex
 It is the number of vertices adjacent to a vertex V.
 Notation − deg(V).
 In a simple graph with n number of vertices, the degree of any vertices is −
deg(v) ≤ n – 1 ∀ v ∈ G (means that for every vertex v in the graph G, the
degree of that vertex is less than or equal to (n - 1), where n is the total
number of vertices in the graph)
 A vertex can form an edge with all other vertices except by itself. So the
degree of a vertex will be up to the number of vertices in the graph minus 1.
This 1 is for the self-vertex as it cannot form a loop by itself. If there is a loop
at any of the vertices, then it is not a Simple Graph.
 Degree of vertex can be considered under two cases of graphs −
 Undirected Graph
 Directed Graph
 Degree of Vertex in an Undirected Graph
An undirected graph has no directed edges.

Example 1

In the above Undirected Graph,


deg(a) = 2, as there are 2 edges meeting at vertex ‘a’.
deg(b) = 3, as there are 3 edges meeting at vertex ‘b’.
deg(c) = 1, as there is 1 edge formed at vertex ‘c’
So ‘c’ is a pendent vertex.
deg(d) = 2, as there are 2 edges meeting at vertex ‘d’.
deg(e) = 0, as there are 0 edges formed at vertex ‘e’.
So ‘e’ is an isolated vertex.

Example 2

In the above graph,


deg(a) = 2, deg(b) = 2, deg(c) = 2, deg(d) = 2, and deg(e) = 0.
The vertex ‘e’ is an isolated vertex. The graph does not have any pendent
vertex.
 Degree of Vertex in a Directed Graph
In a directed graph, each vertex has an indegree and an outdegree.

Indegree of a Graph
 Indegree of vertex V is the number of edges which are coming into the
vertex V.
 Notation − deg−(V).

Outdegree of a Graph
 Outdegree of vertex V is the number of edges which are going out from
the vertex V.
 Notation − deg+(V).

Consider the following examples.


Example 1
Take a look at the following directed graph. Vertex ‘a’ has two edges, ‘ad’
and ‘ab’, which are going outwards. Hence its outdegree is 2. Similarly, there
is an edge ‘ga’, coming towards vertex ‘a’. Hence the indegree of ‘a’ is 1.

The indegree and outdegree of other vertices are shown in the following table

Vertex Indegree Outdegree

a 1 2

b 2 0
c 2 1

d 1 1

e 1 1

f 1 1

g 0 2

Example 2
Take a look at the following directed graph. Vertex ‘a’ has an edge ‘ae’ going
outwards from vertex ‘a’. Hence its outdegree is 1. Similarly, the graph has
an edge ‘ba’ coming towards vertex ‘a’. Hence the indegree of ‘a’ is 1.

The indegree and outdegree of other vertices are shown in the following table

Vertex Indegree Outdegree

a 1 1

b 0 2

c 2 0

d 1 1

e 1 1
Pendent Vertex
By using degree of a vertex, we have a two special types of vertices. A vertex with
degree one is called a pendent vertex.

Example

Here, in this example, vertex ‘a’ and vertex ‘b’ have a connected edge ‘ab’. So with
respect to the vertex ‘a’, there is only one edge towards vertex ‘b’ and similarly with
respect to the vertex ‘b’, there is only one edge towards vertex ‘a’. Finally, vertex
‘a’ and vertex ‘b’ has degree as one which are also called as the pendent vertex.

Isolated Vertex
A vertex with degree zero is called an isolated vertex.
Example

Here, the vertex ‘a’ and vertex ‘b’ has a no connectivity between each other and
also to any other vertices. So the degree of both the vertices ‘a’ and ‘b’ are zero.
These are also called as isolated vertices.

Adjacency
Here are the norms of adjacency −
 In a graph, two vertices are said to be adjacent, if there is an edge between
the two vertices. Here, the adjacency of vertices is maintained by the single
edge that is connecting those two vertices.
 In a graph, two edges are said to be adjacent, if there is a common vertex
between the two edges. Here, the adjacency of edges is maintained by the
single vertex that is connecting two edges.
Example 1

In the above graph −


‘a’ and ‘b’ are the adjacent vertices, as there is a common edge ‘ab’ between them.
‘a’ and ‘d’ are the adjacent vertices, as there is a common edge ‘ad’ between them.
ab’ and ‘be’ are the adjacent edges, as there is a common vertex ‘b’ between them.
be’ and ‘de’ are the adjacent edges, as there is a common vertex ‘e’ between them.

Example 2

In the above graph −


‘a’ and ‘d’ are the adjacent vertices, as there is a common edge ‘ad’ between them.
‘c’ and ‘b’ are the adjacent vertices, as there is a common edge ‘cb’ between them.
‘ad’ and ‘cd’ are the adjacent edges, as there is a common vertex ‘d’ between them.
‘ac’ and ‘cd’ are the adjacent edges, as there is a common vertex ‘c’ between them.
Parallel Edges
In a graph, if a pair of vertices is connected by more than one edge, then those
edges are called parallel edges.

In the above graph, ‘a’ and ‘b’ are the two vertices which are connected by two
edges ‘ab’ and ‘ab’ between them. So it is called as a parallel edge.

Multi Graph
A graph having parallel edges is known as a Multigraph.
Example 1

In the above graph, there are five edges ‘ab’, ‘ac’, ‘cd’, ‘cd’, and ‘bd’. Since ‘c’ and
‘d’ have two parallel edges between them, it a Multigraph.

Example 2

In the above graph, the vertices ‘b’ and ‘c’ have two edges. The vertices ‘e’ and ‘d’
also have two edges between them. Hence it is a Multigraph.
Degree Sequence of a Graph
If the degrees of all vertices in a graph are arranged in descending or ascending
order, then the sequence obtained is known as the degree sequence of the graph.
Example 1

Vertex a b c d e

Connecting to b,c a,d a,d c,b,e d

Degree 2 2 2 3 1

In the above graph, for the vertices {d, a, b, c, e}, the degree sequence is {3, 2, 2,
2, 1}.

Example 2

Vertex a b c d e f

Connecting to b,e a,c b,d c,e a,d -

Degree 2 2 2 2 2 0

In the above graph, for the vertices {a, b, c, d, e, f}, the degree sequence is {2, 2,
2, 2, 2, 0}.
Types of Graphs
Graphs can be classified into various types based on different properties and
characteristics.

Some of the common types of graphs include:


1. Directed Graphs (Digraphs): In directed graphs, each edge has a direction
associated with it, indicating a one-way connection between vertices.
Directed graphs are used to model asymmetric relationships or flows of
information, such as transportation networks with one-way streets or social
networks with directed friendships.

2. Undirected Graphs: In undirected graphs, edges have no inherent direction,


and connections between vertices are bidirectional. Undirected graphs are
used to model symmetric relationships, such as friendships in social
networks or connections in a computer network.

3. Weighted Graphs: Weighted graphs have numerical values associated with


each edge, known as weights. These weights represent the cost, distance,
or some other quantitative measure associated with traversing the edge.
Weighted graphs are used in applications where the edges represent varying
levels of cost or distance, such as in transportation networks or optimization
problems.

4. Unweighted Graphs: Unweighted graphs do not have weights associated


with edges. In these graphs, the edges are considered to have equal weight
or cost. Unweighted graphs are commonly used in applications where the
edges represent simple connections or relationships, such as social
networks or modeling dependencies between tasks in a project.

5. Connected Graphs: A graph is connected if there is a path between every


pair of vertices. In other words, all vertices in the graph are reachable from
every other vertex. Connected graphs are used to model systems with no
isolated components, such as communication networks or social networks.
6. Disconnected Graphs: A graph is disconnected if it contains two or more
connected components, where each connected component is a subgraph in
which every pair of vertices is connected by a path, but no vertex in one
component is connected to any vertex in another component. Disconnected
graphs may represent systems with isolated components or separate
clusters, such as disconnected subnetworks in a computer network.

7. Complete Graphs: In a complete graph, every pair of distinct vertices is


connected by a unique edge. Complete graphs are denoted by the symbol
K_n, where n represents the number of vertices. Complete graphs are used
in theoretical studies and as a reference point for comparing other types of
graphs.

8. Bipartite Graphs: Bipartite graphs are graphs whose vertices can be divided
into two disjoint sets such that every edge connects a vertex from one set to
a vertex in the other set. Bipartite graphs are used to model relationships
between two distinct types of entities, such as students and courses in a
class scheduling problem or customers and products in a market analysis.

These are just a few examples of the types of graphs commonly encountered in
graph theory and its applications. Graphs can also be classified based on
additional properties, such as planarity, density, and regularity, among others.

References:
https://byjus.com/maths/graph-theory
https://www.tutorialspoint.com/graph_theory/graph_theory_introduction.htm
https://builtin.com/machine-learning/graph-theory
https://www.geeksforgeeks.org/mathematics-euler-hamiltonian-paths

You might also like