Intro To Graph Theory
Intro To Graph Theory
Objective:
To introduce students to the fundamental concepts of graph theory
and its applications in computer science.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Example
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
Example
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
Example 2
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).
The indegree and outdegree of other vertices are shown in the following table
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
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
Example 2
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
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
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.
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