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

Module 8 - Mathematics of Graphs

Graphs

Uploaded by

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

Module 8 - Mathematics of Graphs

Graphs

Uploaded by

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

Module 8.

MATHEMATICS OF GRAPHS

Good day, learner! I hope that you had understood the


essence and rules of Mathematics of Finance. The insights
that you had learned from that lesson is very vital to
understanding your financing. This time, you are going to
learn the science of graph theory. This is the third lesson for
your pre-finals. The knowledge of graph theory is essential for
your future creation of goals and direction in your journey
called life.

Introduction to Graph Theory


Graph Theory began with Leonhard Euler in his study of the Bridges of K¨onigsburg problem. Here’s how it started: The
city of K¨onigsburg exists as a collection of islands connected by bridges as shown in Figure below. The problem Euler wanted to
analyze was: Is it possible to go from island to island traversing each bridge only once? This was assuming that there was no
trickery such as using a boat. Euler analyzed the problem by simplifying the representation and as a result created modern graph
theory. We’ll come back to Euler’s solution later.

Graph Theory – is a branch of mathematics created to


solve problems involving the most efficient way to travel between
different directions; it was developed after Leonhard Euler solved
an eighteenth-century problem in solving the seven bridges of
Pregel River in a city now called Kaliningrad in a modern Russia.

Graph theory is used to find shortest path in road or a


network. In Google Maps, various locations are represented as
vertices or nodes and the roads are represented as edges and graph
theory is used to find the shortest path between two nodes.

A graph – is a set of points called vertices or nodes and line segments or curves called edges that connect vertices.

A graph may also contain a loop. A loop is an edge that begins and ends at the same vertex.

Graphs can be used to represent different scenarios: cities or map, floor plans for houses, border relationships of states or countries
or family relationships between people.

Graph Theory Terminology


vertex
• Edge – is a line connecting two vertices called endpoints
• Order of a graph – is the number of its vertices edge

• Degree of a vertex – is the number of edges that intersect the loop
vertex
• Even vertex – has an even number of edges that intersect the
vertex
• Odd vertex – has an odd number of edges that intersect the vertex.
• Adjacent vertices – pair of vertices joined by an edge. Otherwise, they are non-adjacent.
• Incident – term describing an edge if it is joined to a vertex.
Page 1
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
• Loop – edge that begins and ends at the same vertex.
• Link – has two distinct end vertices.
• Multigraph – graph with multiple edges; allowing more than one edge to connect between two vertices; such edges are
called multiple edges.
• Pseudograph – graph with loops and multiple edges

multigraph pseudograph

• Walk – alternating sequences of vertices and edges, with each edge being incident to the vertices immediately preceding
and succeeding it in the sequence.
• Trail – walk with no repeated edges.
• Path – walk with no repeated vertices.
• Closed walk – walk with its initial vertex as also its terminal vertex.
• Open walk – walk with its initial vertex different from its terminal vertex.
• Cycle – closed trail with at least one edge and no repeated vertices except that the initial vertex is the terminal vertex.
• Girth of a graph – length of a shortest (simple) cycle in the graph
• Circumference of a walk – length of the longest cycle in the graph
• Length of a walk – number of edges in the sequence defining the walk; thus the length of a path or cycle is also the
number of edges in the path or cycle
• If u and v are the vertices, the distance from u to v is the length of the shortest path from u to v.

A B

X Z
Y

What is the walk from A to Z? Trail? Path?


What are the cycles of graph G?
What is the girth of the graph? Circumference?

Answers:
• AZ Walk: (ABZ), (ABYZ), (AXYBZ), (ABYXABYZBZ)
• AZ Trail: (ABZ), (ABYZ), (AXYZ), (AXYBZ)
• AZ Path: (ABZ), (ABYZ), (AXYZ), (AXYBZ)
• G cycles: (ABZYXA), (ABYXA), (BYZB)
• Girth of G: 3
• Circumference of G: 5

Connected Graph – graph in which every pair of its vertices is connected by a path; otherwise, the graph is disconnected

Page 2
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
A graph that is disconnected two or more pieces, called components of the graph.
• cut vertex/cut point – vertex whose removal disconnects the remaining subgraph
• bridge/cut edge – edge whose removal disconnects the graph

A C
E
F

D D

Cut points: A and D


Bridges: AF and DE

Traversable Graph
A graph is traversable if you can draw a path between all the vertices without retracing the same path. Based on this path, t here
are some categories like Euler’s path and Euler’s circuit which are described in this module.
Euler’s Path
An Euler’s path contains each edge of ‘G’ exactly once and each vertex of ‘G’ at least once. A connected graph G is said to b e
traversable if it contains an Euler’s path.
Example

Euler’s Path = d-c-a-b-d-e.

Euler’s Circuit
In a Euler’s path, if the starting vertex is same as its ending vertex, then it is called an Euler’s circuit.
Example

Page 3
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
Euler’s Path = a-b-c-d-a-g-f-e-c-a.

Euler’s Circuit Theorem


A connected graph ‘G’ is traversable if and only if the number of vertices with odd degree
in G is exactly 2 or 0. A connected graph G can contain an Euler’s path, but not an Euler’s
circuit, if it has exactly two vertices with an odd degree.
Note − This Euler path begins with a vertex of odd degree and ends with the other vertex
of odd degree.

Euler’s Path − b-e-a-b-d-c-a is not an Euler’s circuit, but it is an Euler’s path. Clearly it
has exactly 2 odd degree vertices. Figure on the right.
Note − In a connected graph G, if the number of vertices with odd degree = 0, then Euler’s
circuit exists.

Hamiltonian Graph
A connected graph G is said to be a Hamiltonian graph, if there exists a cycle which contains all the
vertices of G.
Every cycle is a circuit but a circuit may contain multiple cycles. Such a cycle is called a Hamiltonian
cycle of G.
A path or cycle is Hamiltonian if it uses all vertices exactly once. A graph that contains a Hamiltonian graph is traversable; and one
that contains a Hamiltonian path for any given pair of (distinct) endvertices is a Hamiltonian connected graph.

Hamiltonian Path
A connected graph is said to be Hamiltonian if it contains each vertex of G exactly once. Such a path is called a Hamiltonian path.
Example (Figure on the right)
Hamiltonian Path− e-d-b-a-c.
Note
• Euler’s circuit contains each edge of the graph
exactly once.
• In a Hamiltonian cycle, some edges of the graph
can be skipped.
Example
Take a look at the graph on the right
For the graph shown:
• Euler path exists – false
• Euler circuit exists – false
• Hamiltonian cycle exists – true
• Hamiltonian path exists – true
G has four vertices with odd degree, hence it is not
traversable. By skipping the internal edges, the graph has a
Hamiltonian cycle passing through all the vertices.

Page 4
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
A graph is traversable if there is trail that which includes all vertices and passes each edge exactly once. In other words, “it can
be drawn without any break in the curve and without repeating any edges.”

Example:

A graph with more than 2 vertices with an odd degree is not traversable.

Eulerian Graph

A trail or circuit (or cycle) is Eulerian if it uses all edges precisely once. A graph that contains an Eulerian trail is
traversable. A graph that contains an Eulerian circuit is an Eulerian graph.

A graph is Eulerian if and only if the degree of each vertex is even.

Directed Graph (or Digraph)

A directed graph is a graph whose edges have directions.

Parallel edges - In a digraph, a pair of edges in which one is directed from vertex a to vertex b and the other is directed from
vertex b to vertex a.

A E

B C D

Page 5
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
In a digraph, we distinguish the out-degree as the number of edges leaving a vertex, and the in-degree, the number of edges
entering a vertex. The degree of a vertex, is the sum of its out-degree and in-degree.

A source is a vertex with 0 in-degree; and


A sink is a vertex with 0 out-degree.

Example:
a b
c d

f e

Source: a
Sink: c and d
a b c d e f g
In-degree 0 2 2 4 1 2 1
Out-degree 4 1 0 0 3 2 2
Degree 4 3 2 4 4 4 3

Weighted Graph
Weighted graph – associates a value (weight) with every edge in the graph. The weight of a path in a weighted graph is the
sum of the weights of the traversed edges. Sometimes the words cost or length is used instead of weight.

Example:
b 3 d
1 2
2 2 2
a d 4 g h
2 4
2 3
f 3 e

Trees
Tree T – is a simple graph that if u and v are vertices in T, there exists a unique simple walk from u to v. A tree is connected and
an acyclic graph (a graph with no cycle).

Rooted tree – a tree in which a particular vertex is designed as a root


Level of a tree – length of simple path from the root to a vertex v
Weight of the tree – maximum level number

Page 6
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
A
A is the root of the tree T.
Height of Tree T is 5.
B C D Level of A is 0. Level of E and F is 2, and level G and H is 3.
The parent of H and I is F.
The ancestors of I are F, D and A.
E F
The children of F are H and I.
The descendants of F are H, I, K and L.
I
G H The vertices H and I are siblings.
The vertices of J, C, K and L are leaves.
K L The vertices B, D, E, F, G, H and I are branches.
J

Tree T

Let G be a graph with more than one vertex, then the following statements are equivalent.
• G is a tree.
o Each pair of vertices is connected to exactly one simple path.
o G is connected but if any edge is deleted, the graph becomes disconnected.
o G is acyclic but if any edge is added, the resulting graph has exactly one cycle.
Spanning Trees
A spanning tree is a sub-graph of an undirected connected graph, which includes all the vertices of the graph with a
minimum possible number of edges. If a vertex is missed, then it is not a spanning tree. The edges may or may not have weights
assigned to them. A tree T is a spanning tree of a Graph G if T is a subgraph of G that contains all the vertices of graph G and T
has no cycle.

Example:

Traversing Edges and Applications


One of the earliest problems in graph theory was on the puzzle of the seven bridges of Konigsberg. The seven bridges
are just near each other so one can traverse all the bridges in an afternoon stroll. The question was, “Is it possible to tra verse all
the bridges without repeating at least one of the bridges?

Leonhard Euler of Switzerland analysed the problem and said “No,” it is not possible to walk across all the bridges
without repeating at least one bridge. This is because if we take the land dry places where the bridges connect as nodes or vertices
and the bridges as edges, then we have a vertex with an odd degree.

Page 7
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]
Page 8
Prepared by:
Prof. Ninfa Sua – Sotomil
Cell No: 09171022328
Tel No: 5035955
[email protected]

You might also like