0% found this document useful (0 votes)
99 views76 pages

Graph Theory

Graph theory is the study of graphs, which are diagrams that depict connections and relationships between objects. A graph consists of vertices (nodes) connected by edges. There are different types of graphs such as cyclic, connected, complete, simple, acyclic, weighted, and subgraphs. Graphs can be used to model real-world networks. Important graph concepts include paths, circuits, connectivity, planarity, and graph algorithms like Euler's algorithm, Hamiltonian circuits, and the travelling salesman problem. Solving graph problems involves determining graph properties and finding optimal paths within graphs.

Uploaded by

jfhapac0718val
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)
99 views76 pages

Graph Theory

Graph theory is the study of graphs, which are diagrams that depict connections and relationships between objects. A graph consists of vertices (nodes) connected by edges. There are different types of graphs such as cyclic, connected, complete, simple, acyclic, weighted, and subgraphs. Graphs can be used to model real-world networks. Important graph concepts include paths, circuits, connectivity, planarity, and graph algorithms like Euler's algorithm, Hamiltonian circuits, and the travelling salesman problem. Solving graph problems involves determining graph properties and finding optimal paths within graphs.

Uploaded by

jfhapac0718val
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/ 76

GRAPH

THEORY
Group 6 - MATM
BSN 1-Y1-35
GRAPH
A diagram that contains informations
and depicts connection and relationship
between the various parts of the
diagram.
G = (V, E)
Essential Features of a Graph
The objects - refers to the nodes or vertices
Edges - connecting line
Paths - is a sequence of edgess
Vertex sequence of a path
- a path in written terms of edges
- determines a sequence of
vertices
PATH
Path Length
1. ade 3
2. adc 3
3. bce 3
4. abced 5
5. adecb 5
Vertex sequence of a path
KINDS OF
GRAPH
Cyclic Graph

- a graph
contains at least
one graph cycle.
cyclic graph identification:
1. the path is closed.

2. the path repeat no


edges.

3. the vertices of the


vertex sequence of the
path are all distinct
except for the 1st and
last vertices which are
the same vertices.
Connected Graph
- there is a path
between one vertex
of a graph data
structure and any
other vertex
Complete Graph

- it contains all
possible edges.
- a graph in which
every pair of vertices
is joined by only one
edges.
Simple Graph
- there is just one
edge linking two
vertices, depicting
one-to-one
interactions between
two elements.
Acyclic Graph

- a graph which
does not contain
any cycle.
Weighted Graph

- a graph whose
edges have been
labeled with some
weights or numbers
Subgraph
- The vertices
and edges of a
graph that are
subsets of
another graph .
FLEURY'S
ALGORITHM
utilised to locate an Euler circuit
within a graph,.
Two special circuits
- A closed path in a graph which uses each of the edges exactly
once,

Euler Theorem:
- The graph has an Euler Circuit if the graph is connected and the
degree of the vertices must be even.

Euler Path
- a path that uses each edge of a graph exactly once.

Euler Path Theorem


- a connected graph has an Euler path if and only if the graph has
two vertices of odd degree with all other vertices of even degree.
The graph is connected,
Contains Euler path.

Two of the vertices have odd degree.

By Euler Theorem, the graph has no


Euler Circuit
Not connected,
Does not contain
Euler path and
Euler circuit.
Connected, contains Euler
path,
contains Euler path,
All vertices has an even
degree,
Contains Euler Circuit.
EULER
• Any connected graph is called as an
Euler Graph if and only if all its vertices
are of even degree.

• An Euler Graph is a connected graph


that contains an Euler Circuit
This graph is a connected graph and
all its vertices are of even degree.
EULER PATH
• Euler path is also known as Euler Trail or Euler
Walk.

• If there exists a Trail in the connected graph


that contains all the edges of the graph, then
that trail is called as an Euler trail.

• If there exists a walk in the connected graph


that visits every edge of the graph exactly once
with or without repeating the vertices, then such
a walk is called as an Euler walk
EULER CIRCUIT
•Euler circuit is also known as Euler Cycle or
Euler Tour.

• If there exists a Circuit in the connected graph


that contains all the edges of the graph, then
that circuit is called as an Euler circuit.

• If there exists a walk in the connected graph


that starts and ends at the same vertex and
visits every edge of the graph exactly once with
or without repeating the vertices, then such a
walk is called as an Euler circuit.
SEMI-EULAR GRAPH
• a connected graph contains an
Euler trail but does not contain an
Euler circuit.

• for a graph to be a semi-Euler


graph, following two conditions must
be satisfied:
This graph contains an Euler trail
- Graph must be connected.
BCDBAD.
- Graph must contain an Eul But it does not contain an Euler circuit.
Therefore, it is a semi-Euler graph.
HAMILTON
CIRCUIT
Hamiltonian circuits are named for William
Rowan Hamilton who studied them in the
1800’s.

A circuit that must pass through each


vertex of a graph once and only once.
EXAMPLE

A.

.
EXAMPLE

B. C.
DIRAC’S
THEOREM
consider a connected graph with at least 3
verticles and no multiple edges.

let n be the number of verticles in the


graph

If every vertex has degree of at least n/2,


the the graph must be HAMILTONIAN.
EXAMPLE

No. of vertices: 6
Every vertex has a degree
of at least n/2= 3
Therefore, by Dirac’s Theorem,
the graph is Hamiltonian.
GREEDY
ALGORITHM
Also known as shortest path
algorithm
STEPS:
1. Choose a vertex to start at, then travel along the
connected edge that has the smallest weight.
(if two or more vertices have the same weight, pick any one)

2. After arriving at the vertex, travel along the edge of


smallest weight that connects to a vertex not yet visited.
continue this process until you have visited all vertices.

3. Return to the starting vertex.


2 APPROACHES

1. GREEDY APPROACH- a graph has different numbers in


its vertices and the algorithm is meant to select the
vertex with the largest number.
2. NOT GREEDY - approach that checks all options before
arriving at a final solution, unlike the "greedy approach"
which stops once it gets its results.
EXAMPLE

1. Determine the maximum


value in the tree. There
are two approaches to
solving this problem:
greedy approach or not
greedy.
NOT GREEDY
APPROACH
GREEDY
APPROACH
THE EDGE-PICKING
ALGORITHM
Finding efficient hamiltonian circuit
in complete graphs.
STEPS:

1. Mark the edge of the smallest weight in the graph. (if


two or more edges have the same weight, pick only one.)
2. Mark the edge of next smallest weight in the graph,
as long as it does not complete a circuit not add a third
marked edge to a single vertex.
3. Continue this process until you can no longer mark any
edges. Then mark the final edge that completes the
Hamiltonian circuit.
EXAMPLE
PLANAR
GRAPH
A graph is said to be planar if it can be
drawn in a plane so that no edge cross.
EXAMPLE
REGION OF GRAPH

A region is defined to be an area of the plane that


is bounded by edges and cannot be further
subdivided. A planar graph divides the plans into one
or more regions. One of these regions will be
infinite.
FINITE REGION
If the area of the region is finite, then that
region is called a finite region.

INFINITE REGION
If the area of the region is infinite, that region is
called a infinite region. A planar graph has only one
infinite region.
PROPERTIES OF PLANAR REGION

Regions are bounded by edges.


Every edge can come in contact with either one
or two regions.
An edge bounds a region R if it comes in contact
with R and with another region.
The bound degree b(R) of a region R is the number
of edges that bound that region.
PRACTICE!

Let G be a connected planar simple graph


with 65 vertices and 30 edges. Find the
number of regions in G.

Given-
Number of vertices (v) = 65
Number of edges (e) = 30
SOLUTION!

By Euler’s formula, we know r = e – v + 2.

Substituting the values, we get-


Number of regions (r)
= 65 – 30 + 2
= 37

Thus, Total number of regions in G = 37


PRACTICE!

Let G be a planar graph with 18 vertices, 7


components and 12 edges. Find the number of
regions in G.
Given:
Number of vertices (v) = 18
Number of edges (e) = 8
Number of components (k) = 12
SOLUTION!

Substituting the values, we get-


Number of regions (r)
= 8 – 18 + (12+1)
= -10 + 13
=3

Thus, Total number of regions in G = 3.


NON-PLANAR
GRAPH
A graph is said to be non planar if it
cannot be drawn in a plane so that no
edge cross.
POLYHEDRON

A three-dimensional shape with flat polygonal


faces, straight edges, and sharp corners or
vertices is called a polyhedron.

Common examples are cubes, prisms, pyramids.


However, cones, and spheres are not polyhedrons
since they do not have polygonal faces.
TYPES OF POLYHEDRON
Regular Polyhedron

Regular polyhedrons are made up of


regular polygons. They are also known
as “Platonic solids.” They have all their
faces, edges, and angles congruent.
EXAMPLE
TYPES OF POLYHEDRON
Irregular Polyhedron

An irregular polyhedron has polygonal


faces that are not congruent to each
other. It is made up of polygons having
different shapes. So, all its components
are not the same.
EXAMPLE

1. triangular Prism 2. Octagonal Prism


Kuratowski's
theorem
a graph is planar if and only if it does
not contain a subgraph that is a subdivision
of either the complete graph
In simpler terms, a graph is planar if it can be drawn on
a plane without any edges crossing each other .

This theorem provides a practical way to determine


whether a graph is planar by checking for the absence
of certain configurations within it. It has been influential
in graph theory and is a key concept in understanding
the structure of planar graphs.
https://images.app.goo.gl/hSbMBMnSi99FmeQc7
TRAVELLING SALESMAN
PROBLEM
Given an undirected graph, and cost for each edge of
that graph, find a Hamiltonian circuit of minimum
total cost
In 1859, Sir William Rowan Hamilton marketed a
game called Around the World. The game consisted
of a regular dodecahedron made of wood. Each
corner bore the name of a famous city of the
world. The game was to find a path starting at any
city, travelling along the edges of the dodecahedron,
visiting each city exactly once and returning to the
starting city.
The diagram represent the game.
V1V2V3V4V5V14V13V12V11V10V9V8V7V17V18V19V20V16V15V6V1.
Theory The Pipeline Problem
The MAYNILAD is considering 8 cities to be connected by a pipeline. The distances (in
km) between cities are given in the graph below:
Theory The Pipeline Problem
The MAYNILAD is considering 8 cities to be connected by a pipeline. The distances (in
km) between cities are given in the graph below:
Total weight of the
minimal spanning
tree
= 80 + 90+ 80+150
+60+70+105 = 635
Therefore, Maynilad
needs 635km length
of pipeline to
connect the 8 cities.
Metric
Traveling
a subcase of the Travelling
Salesman Problem (TSP)
Metric Traveling
- It is a key
problem in combinatorial optimization.
Solutions of the Metric TSP are generally
used for costs minimization tasks in
logistics, manufacturing and genetics.
THANK YOU FOR
LISTENING!
REFERENCES :
https://courses.lumenlearning.com/mathforliberalartscorequisite/chapter/hamiltonian-circuits/

https://math.libretexts.org/Bookshelves/Applied_Mathematics/Book%3A_College_Mathematics
_for_Everyday_Life_(Inigo_et_al)/06%3A_Graph_Theory/6.04%3A_Hamiltonian_Circuits

https://www.javatpoint.com/hamiltonian-circuit-problems

https://www.freecodecamp.org/news/greedy-algorithms/

https://youtu.be/ISWo-9i_faU?si=W4Q6Xp72cHw7lzbB

https://www.scribd.com/presentation/474731869/Edge-Picking-Algorithm

https://www.freecodecamp.org/news/greedy-algorithms/
SHORT QUIZ
Does a Hamiltonian path or circuit exist on the graph below?
SHORT QUIZ
Does a Hamiltonian path or circuit exist on the graph below?

G. H.
SHORT QUIZ
Does a Hamiltonian path or circuit exist on the graph below?

I. J. K.
SHORT QUIZ

Which of the
following is/ are
Euler Graphs?
SHORT QUIZ

Which of the
following is/ are
Euler Graphs?
SHORT QUIZ
PROBLEM 1:

Let G be a connected planar simple graph with 25 vertices


and 60 edges. Find the number of regions in G.

PROBLEM 2:

Let G be a planar graph with 10 vertices, 3 components and


9 edges. Find the number of regions in G.
SHORT QUIZ
PROBLEM 3:

Let G be a connected planar simple graph with 20 vertices


and dehgree of each vertex is 3. Find the number of regions
in G.
PROBLEM 4:

Let G be a connected planar simple graph with 35 regions,


degree of each region is 6. Find the number of vertices in G.

You might also like