Module 6. Mathematics of Graphs (1)
Module 6. Mathematics of Graphs (1)
Mathematics of Graphs
Introduction
The middle part of the 18th century saw the birth and the
expansive evolution of graph theory as a branch of mathematics.
Coming from an unusual origin, graph theory has developed into
one of the richest fields of mathematics in terms of applications
and theory.
Introduction
Unlike a “graph” that you learned in algebra and calculus (e.g.
polynomial graphs, exponential graph), or those that you
encountered in statistics (e.g. bar graph, pie chart), “graph” in
graph theoretic context is much simplified as consisting of points
(or vertices) and lines (or edges) and has no regard to
coordinates and distances.
In “social” network:
Where are graphs used?
In biochemistry:
Where are graphs used?
In Chemistry
Where are graphs used?
In communication network
Objectives
❑ Lay out the basic concepts of graph theory that are considered
essential in modeling real-life situations.
❑ Use graph theory approach to analyze and find solutions to real-life
problems.
❑ Apply algorithms to solve problems on Hamiltonian graphs, Eulerian
graphs, weighted graphs, planar graphs and coloring problems
including their applications to real-life situations.
Section 6.1 Modeling with Graphs
Historical Background : The Konigsberg Bridge Problem
https://www.youtube.com/watch?v=nZwSo4vfw6c
Intended Learning Outcomes
At the end of the module, students should be able to:
If the pairs are ordered, then the resulting graph is said to be directed,
otherwise it is undirected. In both cases, we specify a graph G as
G = (V,E).
The cardinality of V is referred to as the order of the graph while the
cardinality of E is its size.
Definitions
If 𝑥 and 𝑦 are vertices of a graph G, that is, 𝑥, 𝑦 ∈ V then an edge 𝑒 can
be denoted as 𝑒 = (𝑥, 𝑦) ∈ E. In this case, the vertices 𝑥 and 𝑦 are said
to be adjacent and that the edge 𝑒 is incident on 𝑥 (or on 𝑦).
V E B A C
order: |V| = 6
size: |E| = 5
E D F
Example 1 : Simple Undirected Graph
G = ({A,B,C,D,E,F},{{A,B},{A,C},{A,D},{D,E},{D,F}}) = (V,E)
V E B A C
order: |V| = 6
size: |E| = 5
E D F
Example 1 : Simple Undirected Graph
G = ({A,B,C,D,E,F},{{A,B},{A,C},{A,D},{D,E},{D,F}}) = (V,E)
V E B A C
For brevity, use AB to mean the edge {A,B}.
G = ({A,B,C,D,E,F},{AB,AC,AD,DE,DF}).
Vertex degrees:
Vertex A B C D E F
Degree 3 1 1 3 1 1
E D F
Exercise
Let V = {A, B, C, D, E} and E = {AB, AC, AE, BC, BD, CE}. Draw the
corresponding graph and find the following:
a. order of G
b. size of G
c. degree of the vertices
Remarks
a. The lengths of the edges do not matter.
b. The location of the vertices does not matter.
c. Edges are not limited to straight lines; curved lines (or arcs) may
also be used.
d. The relative placement of the vertices does matter.
e. Graphs may appear different in form but as long as the adjacency is
followed based on the edge set E, then such graphs refer to the same
graph (isomorphism of graphs).
Isomorphic Graphs
H = ({A,B,C,D,E,F},{(A,C),(A,B),(B,A),(D,A),(B,E),(B,F)})
Directed Graphs
Because of the direction, there is a need to identify the initial and
terminal vertices, like in the edge (A,B), vertex A is the initial while
vertex B is the terminal vertex. Edges that are directed towards a
vertex comprise the in degree of the vertex while those that are
directed away comprise the out degree.
Types of Graphs
Multigraph
G = ({A,B,C},{AB,AB,AB,BC,CC})
Multi-edge Loop
Types of Graphs
Null Graph
G = ({A,B,C}, ∅ )
Types of Graphs
Paths
Types of Graphs
Cycles
Types of Graphs
Complete Graphs
Exercise
In their effort to improve the research
culture among students and teachers, five
universities in Metro Manila have agreed to
open their libraries for mutual utilization.
The table below summarizes which school
can use the library services of another
school. An “X” mark simply means that
students and faculty of the involved
universities can use both their library
services.
Exercise
a. Draw the graph according to the
“X” marks in the table.
b. Which school is most liberated
when it comes to accepting
students and faculty from other
schools?
c. Which school is least liberated?
Exercise
Five individuals met to discuss a
new business venture. Before the
meeting started, they shook hand
with each other. The graph below
shows the handshakes that took
place. An edge connect two persons
if they shook hands before the
meeting.
Exercise
a. Did JC and Dex shake hands?
b. How many individuals did Prince
shake hands with?
c. Among the five individuals, who
shook hands with most people in
the meeting?
d. Would it make sense if the graph
has a multiple edge?
e. Would it make sense if the graph
has a loop?
Section 6.2 Hamiltonian and Eulerian Graphs
Hamiltonian?
Illustration: Hamiltonian?
The graph is of order 6 and half of this number is 3. The minimum degree of the
graph is only 2 (at vertices A and E). By this, Dirac’s Theorem is no longer
applicable and so we cannot test the hamiltonicity on the basis of the said
theorem. By trial and error, we can test the hamiltonicity. In fact, we can easily
trace a Hamiltonian cycle: A-B-E-F-D-C-A. Thus, the graph is Hamiltonian.
Exercise: Which graph is Hamiltonian?
Example
A large law firm has offices in seven major cities. The firm has overnight document
deliveries scheduled every day between certain offices. In the graph below, an
edge between vertices indicates that there is delivery service between the
corresponding offices. Use Dirac’s theorem to answer the following question:
Using the law firm’s existing delivery service, is it possible to route a document to
all the offices and return the document to its originating office without sending it
through the same office twice?
Section 6.3 Weighted Graphs
In many applications, you can use the edges or the vertices of a graph to represent
real-life metrics. In navigation, for example, the vertices may mean destinations
while the edges may mean the distance or cost of traveling from one point to
another. In communication network, the edges may indicate loading capacity.
Informally, any value that is assigned to the edges is called weight. In such cases,
the question of whether the graph is Eulerian or Hamiltonian should no longer be
constrained to utilizing the vertices or edges of the graph, but to make the process
more efficient by optimizing the weights in the graph.
Assigning weights to the edges of a graph is the labeling aspect of a graph. Graph
labeling has become one rich area of graph theory in terms of research
opportunities because of the unlimited areas where this concept can be applied.
Learning Outcomes
At the end of the section, students should be able to:
1. define and illustrate a weighted graph;
2. explain and execute algorithms for identifying
Hamiltonian cycles in weighted graphs; and
3. use the algorithms to solve practical problems about
weighted graphs.
Definitions
A 8 B
- A graph is considered weighted if its
edges are assigned numeric values 2
called weights.
6 3
- A weighted graph is a graph where 4
every edge has associated numeric
value (called weight) 5
D C
Weighted K4
Illustration
A 8 B
One problem that can be addressed with weighted
graphs is to traverse all the vertices through the least
2
total weights possible.
Examine the total weights for all possible Hamiltonian 6 3
cycles of the weighted K4 shown on the right. 4
D 5 C
Weighted K4
The Greedy Algorithm
2 2 2 2
6 3 6 3 6 3 6 3
4 4 4 4
D 5 C D 5 C D 5 C D 5 C
2 + 3 + 4 + 6 = 15
Example
Egay is tasked to distribute examination papers during the quarterly examination
of the mathematics department. From the office, he has to bring the test papers
and answer sheets to four examination areas in the campus: North Building, South
Building, West Building, and Southwest Building. The table below summarizes the
roaming time from one area to other areas. Determine the roaming route that
gives the least time for the distribution of the examination materials.
Example
Example
Possible routes:
Office-South-Southwest-West-North-Office
Office-North-West-Southwest-South-Office
Exercise
The cost of flying between
various European cities is
shown in the following
table. Use both the greedy
algorithm and the edge-
picking algorithm to find a
low-cost route that visits
each city just once and
starts and ends in London.
Which route is more
economical?
Section 6.4 Graph Coloring
Graph coloring is another aspect of graph labeling. Here, the main objective is to
color the vertices of the graph with the least possible number of colors such that
no two adjacent vertices share the same color. Although this may appear just yet
another tricky mathematical problem, graph coloring has found its way into
countless applications of practical values.
The accelerated interest in graph theory can be attributed to graph coloring. In
fact, it took almost a hundred years for a classical problem to be settled—the Four
Color Theorem. It states that if a graph can be drawn such that its edges do not
intersect, then it takes no more than four colors for its vertices to be colored
(again, no two adjacent vertices share the same color).
Learning Outcomes
At the end of the section, students should be able to:
1. define graph coloring;
2. illustrate proper coloring of a graph;
3. specify the conditions and procedures of implementing
proper coloring of graphs; and
4. use the concept of graph coloring to solve real-life
problems.
Introduction: Planar Graphs
The graph on the right is called the Utility Graph, usually denoted as K3,3.
Introduction: Planar Graphs
The Utility Graph is NOT PLANAR………………….and so is the complete graph K5.
Non-Planar Graph Theorem
https://www.youtube.com/watch?v=RSSfO0lnEp8
Graph Coloring
E F
Example
Let us try to exhibit a (proper) coloring of the graph shown on A
the right. First, color vertex A with red. This forces a different
color to the vertices B, C, E, and F since these 4 vertices are all
adjacent to A. C
B
E F
Example
Let us try to exhibit a (proper) coloring of the graph shown on the A
right. First, color vertex A with red. This forces a different color to
the vertices B, C, E, and F since these 4 vertices are all adjacent to
A. C
B
Let us assign blue to B.
D
This also permits C to be assigned blue also (why?).
A new color, say green, has to be assigned to E since it is adjacent
to C. Similarly, F may be assigned a green color.
Finally, since D is not adjacent to D, this vertex can also use red.
E F
Thus, we need only 3 colors to exhibit a coloring of the graph.
This shows that 𝜒(G) = 3, or that the graph is 3-colorable.
Remarks
A B
F C
E D
Application: Traffic Light
A B
F C
E D
Application: Traffic Light