Weighted Graphs
and Isomorphic
Graphs
By: Kurt Florence L. Talan
Learning Objectives:
At the end of this presentation, you will be able to:
1. Define weighted graphs, isomorphism, and isomorphic graphs.
2. Tell wether given graphs are isomorphic or not
3. Understand and be able to use the greedy algorithm and edge-picking-algortithm
4. Find a hamiltonian circuit using greedy algorithm and edge-picking-algorithm
5. Understand injection, surjection, and bijection.
6. Understand the graceful, near graceful, and harmonius labeled graphs
Contents of this presentation:
Here are subtopics which will be clarified throughout the presentation:
1. Weighted Graphs
2. Isomorphism and Isomorphic Graphs
3. The Greedy Algorithm
4. Edge Picking Algorithm
5. Finding a Hamiltonian Circuit in a Weighted Graph
6. Injective and Bijective graph labelling
01
Weighted Graphs
Definition and other Information
Weighted graph
◈ A labeled graph in which each edge is associated with a value, called
a WEIGHT or COST of the edge
◈ WEIGHT, COST or the value can represent any quantity (e.g.
distance, time, costs, etc.)
◈ Can be denoted as (V, E), where V is a finite set of vertices while E
is a finite set of edges
◈ Usually, the edge weights are non-negative integers
◈ May either be either directed or undirected
Examples:
Example 01 Laguna 114 km
Quezon
A table that shows distance from
different provinces 89 km
Province Laguna Batangas Rizal Quezon
81 km 210 km
Laguna --- 81 km 89 km 114 km
04
Batangas 81 km --- 137 km 160 km 160 km
Rizal 89 km 137 km --- 210 km
Batangas
Quezon 114 km 160 km 210 km --- 137 km Rizal
Examples:
Example 02 15 Php
Sta. Cruz Pagsanjan
A table that shows Jeepney Fair
Rates
Place Sta. Cruz Lumban Pagsanjan Liliw
30 Php
30 Php
Sta. Cruz --- --- 15 Php 30 Php
04 15 Php
Lumban --- --- 15 Php ---
Pagsanjan 15 Php 15 Php --- 30 Php
Lumban Liliw
Liliw 30 Php --- 30 Php ---
02
Isomorphism and
Isomorphic Graphs
Definition and other Information
But first, we need to define Homomorphism
and Enumerate its Classifications.
Homomorphism
◈ From Greek “homois morphe”, meaning “similar form”
◈ A special correspondence between the members (elements) of two
algebraic systems, such as two groups, two rings, or two fields.
◈ Two homomorphic systems have the same basic structure, and, while
their elements and operations may appear entirely different, results
on one system often apply as well to the other system.
◈ Thus, if a new system can be shown to be homomorphic to a known
system, certain known features of one can be applied to the other,
thereby simplifying the analysis of the new system.
Types of Homormorphisms
Epimorphism Monomorphism Isomorphism Automorphism Endomorphism
- Surjective - Injective - Bijective - isomoprhism, - homomorphism,
homomorphism homomorphism homomorphism domain and domain and
codomain are the codomain are the
same group same group
Surjective, Injective, and Bijective
Surjective Injective Bijective
Means we won’t have two Means both injective and surjective, every
Every “B” has at least one
or more “A”s pointing to one has a partner and no one is left out, while
matching “A” (can be more
the same “B”; also called still maintaining the one-to-one
than one).
“one-to-one” correspondence
Isomorphism
◈ In modern algebra, a one-to-one correspondence (mapping) between
two sets that preserves binary relationships between elements of the
sets.
◈ Two graphs are said to be equal if they have the exact same distinct
elements, but sometimes two graphs can “appear equal” even if they
aren’t, and that is the idea behind isomorphisms.
Isomorphism
◈ Two simple graphs, G and H, are isomorphic if there is a
bijection which preserves adjacency and non adjacency.
◈ An isomorphism of graphs G and H is a bijection between the
vertex sets of G and H
◈ Such that any two vertices, a and b, of G are adjacent in G if
and only if f(a) and f(b) are adjacent in H
How to tell if a
Graph is Isomorphic
Method 1: Checklist
◈ All we have to do is ask the following questions:
○ Are the number of vertices in both graphs
the same? Yes, there are both 5 vertices in
each graph.
○ Are the number of edges in both graphs the
same? Yes, they are both 4 edges in each
graph.
○ Is the degree sequence in both graphs the
same? Yes (A,B,C,D,E) = (2,1,3,1,1),
(P,Q,R,S,T) = (1,3,1,2,1)
How to tell if a
Graph is Isomorphic
○ One-to-one mapping
How to tell if a
Graph is Isomorphic
○ Edge Preserving Property
How to tell if a
Graph is Isomorphic
○ Adjacency Matrix
A B C D E S T Q R P
A 0 1 1 0 0 S 0 1 1 0 0
B 1 0 0 0 0 T 1 0 0 0 0
C 1 0 0 1 1 Q 1 0 0 1 1
D 0 0 1 0 0 R 0 0 1 0 0
E 0 0 1 0 0 P 0 0 1 0 0
How to tell if a
Graph is Isomorphic
Method 2: Relabeling
◈ Follow the following steps, suppose we want to
show the following two graphs are isomorphic
1. First, we check vertices and degrees and
confirm that both graphs have 5 vertices and
the degree sequence in ascending order is
(2,2,2,3,3)
How to tell if a
Graph is Isomorphic
Method 2: Relabeling
◈ Follow the following steps, suppose we want to
show the following two graphs are isomorphic
2. Now we methodically start labeling vertices
by beginning with the vertices of degree 3
and marking them a and b
How to tell if a
Graph is Isomorphic
Method 2: Relabeling
◈ Follow the following steps, suppose we want to
show the following two graphs are isomorphic
3. Next, we notice that in both graphs, there is
a vertex that is adjacent to both a and b, so
we label this vertex c in both graphs.
How to tell if a
Graph is Isomorphic
Method 2: Relabeling
◈ Follow the following steps, suppose we want to
show the following two graphs are isomorphic
4. This now follows that there are two vertices
left, and we label them according to d and e,
where d is adjacent to a and e is adjacent to
b.
How to tell if a
Graph is Isomorphic
Method 2: Relabeling
◈ Follow the following steps, suppose we want to
show the following two graphs are isomorphic
5. And finally, we define our isomorphism by
relabeling each graph and verifying one-to-
one correspondence.
03
The Greedy Algorithm
Definition and other Information
Greedy Algorithm
◈ A greedy algorithm is an approach for solving a problem by
selecting the best option available at the moment. It doesn’t worry
whether the current best result will bring the overall optimal result.
◈ The algorithm never reverses the earlier decision even if the choice
is wrong. It works in a top-down approach.
◈ May not produce the best result for all the problems. It’s because it
always goes for the local best choice to produce the global best
result.
Greedy Algorithm
◈ However, we can determine if the algorithm can be used with any
problem if the problem has the following properties
○ Greedy Choice Property – A global optimum can be arrived at
by selecting a local optimum.
○ Optimal Substructure – An optimal solution to the problem
contains an optimal solution to subproblems.
Greedy Algorithm
◈ Advantages of greedy approach
○ The algorithm is easier to describe
○ This algorithm can perform better than other algorithms (but,
not in all cases)
◈ Drawback of greedy approach
○ The greedy algorithm doesn’t always produce the optimal
solution.
In depth
Greedy Approach
1. Let’s start with the root node 20. The
weight of the right child is 3 and the
weight of the left child is 2.
2. Our problem is to find the largest path,
and the optimal solution at the moment is
3. So, the greedy algorithm will choose 3.
3. Finally, the weight of an only child of 3 is Apply greedy approach to this tree to find the
1. Thus, gives us our final result longest route
programiz.com
In depth
Greedy Approach
◈ However, it is not the optimal solution.
There is another path that carries more
weight () as shown in the image.
◈ Therefore, greedy algorithms do not
always give an optimal/feasible solution.
The Longest Path
programiz.com
04
Edge Picking Algorithm
Definiton and other
Information
Edge-Picking
Algorithm
◈ States to mark the edge that has the smallest weight in the complete
graph.
◈ Then, the edge with the next smallest weight is marked as long as it
does not complete a circuit and does not add a third marked edge to
a single vertex.
◈ This process continues till no longer an edge can be marked.
In depth
Edge-Picking
Algorithm
1. Mark the edge that has the smallest
weight.
scribd.com
In depth
Edge-Picking
Algorithm
2. Mark the edge of the next-smallest
weight, as long as it does not
complete a circuit, and does not add
a third marked edge to a single
vertex.
scribd.com
In depth
Edge-Picking
Algorithm
2. Mark the edge of the next-smallest
weight, as long as it does not
complete a circuit, and does not add
a third marked edge to a single
vertex.
scribd.com
In depth
Edge-Picking
Algorithm
3. Continue until no more edges can be
marked. That is, until all vertices
have been used.
scribd.com
In depth
Edge-Picking
Algorithm
4. Return to the starting vertex
Total cost/weight
5+ 4+3+5+ 9= 26
scribd.com
05
Finding a Hamiltonian
Circuit in a Weighted Graph
Definition and other
Information
Hamiltonian
Circuit
◈ Is a circuit that visits every vertex once with no
repeats. Being a circuit, it must start and end at the
same vertex.
◈ A Hamiltonian circuit is different from a
Hamiltonian path. A Hamiltonian path also visits
every vertex once with no repeats but does not
have to start and end at the same vertex.
◈ Is named after William Rowan Hamilton, an Irish
mathematician, astronomer, and physicist, who
studied them in the 1800’s
William Rowan Hamilton
physicsworld.com
Hamiltonian
Circuit
◈ Unlike Euler circuits, there is no nice theorem that
allows us to instantly determine whether or not a
Hamiltonian circuit exists for all graphs.
◈ However, there are necessary conditions in which
if a graph doesn’t meet them they are not
Hamiltonian, but if they do they could be
Hamiltonian.
○ Connected
○ No cut vertices
○ No vertex with a degree < 2
Example of a Hamiltonian Circuit
physicsworld.com
Hamiltonian
Circuit
◈ Cycle graphs and complete graphs are always
Hamiltonian.
○ A cycle graph is a simple graph of order n
which is a single cycle of n vertices,
○ A complete graph is a simple graph in order
n where each pair of vertices is adjacent,
From top to bottom, an example of a cycle graph
and a complete graph.
wikipedia.org
Using the Edge-Picking Algorithm
and Greedy Algorithm to solve
problems
Example: miles driven running errands
Errand Home Post Office Grocery Video Store Bank
Home --- 14 12 20 23
Post Office 14 --- 8 12 21
Grocery 12 8 --- 17 11
Video Store 20 12 17 --- 18
Bank 23 21 11 18 ---
Weighted Graph of the problem
scribd.com
Using Edge-Picking Algorithm
scribd.com
Using Edge-Picking Algorithm
scribd.com
Using Edge-Picking Algorithm
scribd.com
Using Edge-Picking Algorithm
scribd.com
Using Edge-Picking Algorithm
scribd.com
Using Edge-Picking Algorithm
Total Cost/Weight:
scribd.com
Using Greedy Algorithm
scribd.com
Using Greedy Algorithm
scribd.com
Using Greedy Algorithm
scribd.com
Using Greedy Algorithm
scribd.com
Using Greedy Algorithm
scribd.com
Using Greedy Algorithm
Total Cost/Weight:
scribd.com
Comparing the Algorithms
Greedy Algorithm Edge-Picking Algorithm
scribd.com
Total cost = 73 Total cost = 74
06
Injective and Bijective
Graph Labelling
Types, Definition, and other Information
Graceful Labelling
◈ A label of a graph with m edges such that:
◈ Each vertex is labeled with a unique number from
0 to m
◈ An edge between two vertices is the difference
between the two label values and is unique
◈ An edge ranges between 1 to m
Gabe Price in YouTube
Graceful Labelling
◈ A graph is known as graceful when its vertices are
labeled from 0 to |E|, the size of the graph, and this
labelling induces an edge labelling from 1 to |E|.
◈ For any edge e, the label of e is the positive
difference between the two vertices incident with
e. In other words, if e is incident with vertices
labeled i and j, e will be labeled |i − j|.
◈ Thus, a graph G = (V, E) is graceful if and only if
there exists an injection that induces a bijection
from E to the positive integers up to |E|.
Gabe Price in YouTube
Graceful Labelling
◈ Not every graph can have a graceful labeling,
those that aren’t are called ungraceful or
sometimes disgraceful.
◈ On connected graphs, there are E! labellings on a
graph with E edges.
◈ There exists a “near graceful labeling”, which can
be found in graphs with m edges such that:
○ Each vertex is uniquely labeled with
integers from 0 to E+1
○ Edges are uniquely labeled with integers
from 0 to E+1
Gabe Price in YouTube
Harmonious
Labelling
◈ A "harmonious labelling" on a graph G is an
injection from the vertices of G to the group of
integers modulo k, where k is the number of edges
of G, that induces a bijection between the edges of
G and the numbers modulo k by taking the edge
label for an edge (x, y) to be the sum of the labels
of the two vertices x, y (mod k). A "harmonious
graph" is one that has a harmonious labelling. Odd
cycles are harmonious, as are Petersen graphs. It is
conjectured that trees are all harmonious if one
vertex label is allowed to be reused.
FrontierOfScience in YouTube
Harmonious
Labelling
◈ A graph with e edges and v vertices is harmonious
if:
○ We can label the vertices {0,…,v-1}
○ We can label the edges the sum of the vertex
labels next to them mod e, so that we use
{0,…,e-1}
FrontierOfScience in YouTube
Thanks!
Do you have any questions?
[email protected]
Kurt Florence Lumberio Talan
CREDITS: This presentation template was created by
Slidesgo, including icons by Flaticon and
infographics & images by Freepik
Please keep this slide for attribution
Credits
◈ https://mathworld.wolfram.com/WeightedGraph.html
◈ https://study.com/academy/lesson/weighted-graphs-implementation-dijkstra-algorithm.html#:~:t
ext=A%20weighted%20graph%20refers%20to,to%20compute%20the%20shortest%20path
.
◈ https://www.youtube.com/watch?v=EwV4Puk2coU
◈ https://www.mathsisfun.com/sets/injective-surjective-bijective.html
◈ https://www.britannica.com/science/isomorphism-mathematics
◈ https://www.slideshare.net/sheisirenebkm/isomorphism-48645444
◈ https://calcworkshop.com/trees-graphs/isomorphic-graph/
◈ https://www.slideshare.net/corecondor/weighted-graphs
◈ https://www.programiz.com/dsa/greedy-algorithm
◈ https://www.youtube.com/watch?v=AamHZhAmR7o
◈ https://www.youtube.com/watch?v=hoTFCx46mFU
◈ https://en.wikipedia.org/wiki/Graph_labeling
◈ https://www.matrix-analysis.com/user/homepage/jburk/courses/HU/Math260/LectureNotes-
GraphTheory.pdf
Credits
◈ https://www.youtube.com/watch?v=yGBh6QZ75-U
◈ https://courses.lumenlearning.com/mathforliberalartscorequisite/chapter/hamiltonian-circuits/#:
~:text=A%20Hamiltonian%20circuit%20is%20a,end%20at%20the%20same%20vertex.
◈ https://www.youtube.com/watch?v=2UczS2hQLsI
◈ https://www.youtube.com/watch?v=wh9mZCUf-z4
◈ https://www.scribd.com/presentation/474731869/Edge-Picking-Algorithm
◈ https://www.assignmentexpert.com/homework-answers/mathematics/discrete-mathematics/quest
ion-140767
◈ https://www.youtube.com/watch?v=HzeK7g8cD0Y
◈ https://www.britannica.com/science/homomorphism
◈ https://courses.cs.vt.edu/~cs3114/Fall10/Notes/T22.WeightedGraphs.pdf
◈ https://en.wikipedia.org/wiki/Graph_isomorphism
◈ https://www.youtube.com/watch?v=b8lUwLMmtZI&list=LL&index=2
◈ https://www.youtube.com/watch?v=0aQD8Em6oGE&list=LL&index=1
Resources
Did you like the resources on this template? Get them for free at our other websites:
Vectors
◈ Vintage design elements collection
◈
◈
Colored education and bookstore stamps
Vintage colored book store poster
Photos
◈ Several antique decor objects ◈ Young woman reading book on white blanke
◈ Retro dressing table vector t
◈ Sketch books set ◈ Portrait of a blonde young woman sitting on
◈ Retro gramophone seamless pattern. vintage white chair at outdoors
background music sound ◈ Portrait of handsome mature man reading ne
wspaper
◈ Set of vector colorful feathers in retro style ◈ Smiling blonde young woman sitting on gar
den chair looking over shoulder
◈ Beautiful young ballet artist dancing