0% found this document useful (0 votes)
1K views51 pages

The Mathematics of Graphs

The document discusses graphs and their mathematical properties. It begins by defining what a graph is - a set of vertices connected by edges. It then defines various graph terminology like order, size, degree of vertices, adjacency, and subgraphs. It discusses different types of graphs such as simple graphs, multigraphs, pseudographs, regular graphs, and complete graphs. It also introduces concepts like paths, cycles, and planar graphs. The document is outlining key graph theory concepts for a class on the mathematics of graphs.

Uploaded by

Jebbrys Largo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views51 pages

The Mathematics of Graphs

The document discusses graphs and their mathematical properties. It begins by defining what a graph is - a set of vertices connected by edges. It then defines various graph terminology like order, size, degree of vertices, adjacency, and subgraphs. It discusses different types of graphs such as simple graphs, multigraphs, pseudographs, regular graphs, and complete graphs. It also introduces concepts like paths, cycles, and planar graphs. The document is outlining key graph theory concepts for a class on the mathematics of graphs.

Uploaded by

Jebbrys Largo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

CHAPTER 10

T HE M A THEM A T IC S
OF G RA P HS
BSCE-1A
GROUP 9
LEARNING OBJECTIVES
• Determining the edges, vertices, order, size, degree vertices, and degree sequence of a graph.
• Identify the adjacent and incident on vertices and edges of a graph.
• Construct different types of graphs.
• Distinguish the difference between a bipartite and a complete bipartite graph.
• Find the complement of a simple graph and complete bipartite graph.
• Differentiate walk, trail, path, circuit, and cycle.
• Show the two given graphs are isomorphic.
• Determine whether a graph is planar or nonplanar.
• Use Euler’s formula to determine planarity of a graph.
• Determine whether a graph is Eulerian, semi-Eulerian and non-Eulerian.
• Explore the applications of graphs.

CHAPTER OUTLINE
Unit 10.1: Basic Concepts
Unit 10.2: Graphs and Euler Circuits
Unit 10.3: Weighted Graphs
Unit 10.4: Euler’s Formula
Unit 10.5: Graph Coloring
UNIT 10.1: BASIC CONCEPTS
A. Introduction
Graph theory is a branch of mathematics concerned with networks of points connected
by lines. It is also defined as the study of graphs and its mathematical structures. It is used
to model pairwise relations between objects from a certain collection. Graph theory started
in recreational math problems but it has grown into a significant area of mathematics with
applications in computer science, social sciences, chemistry, operations research, and in
other fields.
In the field of computer science, graphs are used to represent networks of
communication, data organization, computational devices, the flow of computation, and
others. One good example is the link structure of a certain website which could be
represented by a direct graph. The vertices are the web pages at the website and a directed
edge from page X to page Y exists if and only if page X contains a link to page Y.
UNIT 10.1: BASIC CONCEPTS
We will begin with some definition on the basic terms used in graph theory before we introduce the
types of graphs.
A graph G consists of a non-empty finite set V(G) of elements called vertices (or nodes), and a finite
E(G) of unordered pairs (not necessary distinct) called edges (or edge family). The vertex set is denoted
as V(G) and the edge set is denoted as E(G) of graph G. Note that V(G) = {v1, v2, v3, …, vn} and E(G) =
{e1, e2, e3, …, en}, where v1 is for the vertices and e1 is for the edges. The graph in Figure 10.1 shows
that the set V(G) = {v1, v2, v4, v5} and E(G) = {e1, e2, e3, e4, e5, e6}.
One example of graph is shown in Figure 10.2. The set of vertices of graph G and edge family G is
reflected below: V(G) = {u, v, x, y, z} and E(G) = {uv, vx, xz, yz, uy, vy, uz, vz} = {e1, e2, e3, e4, e5, e6, e7,
e8}.
UNIT 10.1: BASIC CONCEPTS
The order of the graph is number of vertices and its size is determined by counting
the number of edges in a graph. Let us consider Figure 10.2, the order of graph G is 5
and while its size is 8. In addition, the graph G in Figure 10.3 has an order of 6 with a
size of 9.
Two vertices of graph G are adjacent (or neighbors) if there is an edge joining them,
and the edge joining them is called an incident. Likewise, two distinct edges are adjacent
if they have a vertex in common, and the vertex is the connecting the edges is called the
incident.
Given a graph as shown in Figure 10.4, vertex a and vertex b are adjacent to each
other since it is being connected by an edge ab; ab serves as an incident to vertex a and
vertex b. Also edges ab and bc are adjacent since there is a vertex b connecting them;
vertex b serves as an incident to edges ab and bc. Alternatively, vertex a and vertex d are
not adjacent because there is no edge connecting the two vertices.
UNIT 10.1: BASIC CONCEPTS
A pair of vertices consists of more than one edge is called multiple edges or parallel
edges, while an edge whose endpoints are the same vertex is called loop. A graph with no
loops is loop-free. Considering the graph in Figure 10.5 edge ac has multiple edges, while
vertex d contains a loop.
Other important term in graph is its degree. The degree of a vertex of graph G is the
number of edges incident with the vertex noted as deg(v1). The degree of the vertices, a, b,
c, d, and e of graph G in Figure 10.5 are 3, 4, 4, 4, and 1, respectively. The degree vertex is
represented by deg(a)=3, deg(b) = 4, deg(c) = 4, and deg(e) = 1. Take note that a vertex
with loop has a degree of 2.
• In addition, the degree sequence of a graph G consists of the degree written in increasing
order, with repeats are necessary noted as (v1, v2, …, vn) where v1 < v2 < … < vn.
Considering the same graph in Figure 10.5; the graph’s degree sequence is (1, 3, 4, 4, 4)
which was arranged in ascending order. It is written as degree sequence = (1, 3, 4, 4, 4).
UNIT 10.1: BASIC CONCEPTS
Lastly, a vertex is considered isolated if it does not belong to any edge and has a degree of 0 while an end-vertex (or pendant) is a
vertex with a degree of 1. The graph in Figure 10.6 shows that vertex a is an end-vertex f is an isolated vertex.

Theorem 10.1: In a graph G, the sum of the degrees of all vertices is twice the number of edges.
Corollary 10.1: The sum of the degrees of the vertices of a graph is an even number.
Corollary 10.2: In a graph G, the number of odd degree is even.
To verify Theorem 10.1, Corollary 10.1 and Corollary 10.2 by example; let us consider graph in Figure 10.4. The sum of the
degree vertices of the graph is 1 + 3 + 4 +4 + 4 = 16; number of edges is 8; and deg(a) = 3 and deg(e) = 1, thus the number of odd
degrees is e. Theorem 10.1, Corallary 10.1 and Corollary 10.2 hold based from the graph of Figure 10.5
Supplementary Exercise 10.1
1. Draw two examples of graphs.
2. Determine the isolated and end-vertex of the graph in Figure 10.4 if any.
3. Find the degree of all the vertices of the graph in Figure 10.5 and write its degree sequence.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
A. Types of Graphs
In this section, we present some terms which are important in the study of graph
theory. This section formalizes some of the basic definitions with examples.
A simple graph G consists of non-empty finite set V(G) of elements and a finite
set E(G) of distinct unordered pairs of distinct elements of V(G), meaning it is a
graph with no loops and no multiple edges. Figure 10.7 shows graphs G1 and G2 are
examples of simple graphs.
Theorem 10.2: Let G be a simple graph with at least two vertices. Then G has at
least two vertices of the same degree.
Let us consider graphs below in verifying Theorem 10.2. Observe that vertices a
and d; b and e a of graph G in Figure 10.7 have the same degrees. Also, the degree
vertices f, h, j and k of graph G in Figure 10.8 have same degree.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

A multigraph is a graph which consists of a V(G) and E(G) except that E contains
multiple edges. The graphs of the following figures below: Figure 10.9 is with
two multiple edges, Figure 10.10 is with three multiple edges, and the graph of
Figure 10.11 is with four multiple edges are example of multigraph.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
A pseudograph is a graph with at least one loop, the graphs of Figure 10.12 and Figure
10.13 are pseudographs. A trivial graph is a graph with one vertex and no edge; Figure
10.14 illustrates a trivial graph.

A regular graph is a graph in which each vertex has the same degree. If each vertex has
degree r, the graph is regular of degree r or r-regular. The graph G1 in Figure 11.15 is an
example of a regular graph of degree 3. Another example of a regular graph is the graph is
the graph G2 which is known as the Peterson graph shown in the same figure. The graph
was named after Danish Mathematician Julius Peter Christian Petersen (1839-1910) who
developed it.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

An empty graph has no vertices and no edges. A null graph is a graph whose
edge-set is empty. A null graph on n vertices is denoted by N0, N1, N2, N3, and N4,
is shown in Figure 10.16. Note that null graph is a regular of degree 0 and each vertex
is isolated.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
A subgraph of graph G is a graph, each whose vertices belong to V(G) and each edge belong to E(G).
Symbolically, a subgraph of a graph G = (V, E) is a graph G’ = (V’, E’) with V’ C V and E’ C E. As
reflected in Figure 10.7 graph G1 is a subgraph of G2, since all the edges and vertices of C belong to G2.
On the contrary, G1 and G2 are not subgraphs of G3.

A complete graph is a simple graph in which pair of distinct vertices is adjacent (there exactly one edge
joining every pair of vertices). It is denoted by Kn on n vertices and it has ½n(n-1) edges. A complete
graph is a regular graph of degree n-1. Figure 10.18 shows graphs of K3, K4 and K5 with sizes 3, 6, and
10, respectively. Also, the complete graphs K3, K4 and K5 degree vertices are 2, 3, and 4, respectively.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
A cycle graph is connected graph that is regular of degree 2, it is denoted by Cn. Figure 10.19 shows three examples of cycle graphs C3, C4,
and C5. On the contrary, a graph with no cycle is acyclic.

A path graph is a graph obtained from cycle graph (Cn) by removing an edge on n vertices, denoted by Pn. Figure 10.20 illustrates P2, P3, and
P4 graphs. A wheel graph is a graph obtained from Cn-1 by joining each vertex to a new vertex v is the wheel on n vertices, denoted by Wn. Figure
10.21 shows W4, W5 and W6 graphs.

Platonic graphs are graphs which formed from the vertices and edges of the five regular (platonic) solid – the tetrahedron, octahedron, cube,
icosahedron and dodecahedron as shown in Figure 10.22.

Figure 10.23 shows the platonic solids the tetrahedron, octahedron, cube, icosahedron and dodecahedron drawn in a plane. In addition, Table 10.1
shows the basic properties of the five platonic solids in terms of the number of vertices, edges and faces.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

If the vertex set of graph G can be split into disjoint sets A and B so that each edge of G joins a vertex of A and a vertex of B, then G is
a bipartite graph. Alternatively, bipartite graph can be colored black and white vertices. Figure 10.24 illustrates G1 and G2 bipartite
graphs, notice the white vertices are connected to black vertices. In addition, the white vertices are not adjacent to each other, the same
with the black vertices.

Theorem 10.3: A graph G is bipartite if and only if all its cycles have even length.
A complete bipartite graph is a bipartite graph is which vertex in A is joined to each vertex in B by just one’s edge. It is denoted as
K1.3 with 4 for black vertices and s for white vertices. Figure 10.25 shoes three examples of complete bipartite graph, observed that
black vertices are connected with white vertices and there are no multiple edges.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

Supplementary Exercise 10.2A


1. Construct two graphs for each type: simple graphs, multigraphs,
pseudographs, and regular graphs.
2. Construct two different subgraphs of a complete graph K3.
3. Construct the following graphs K6, N3, C6, P5 and W7.
4. Draw 2 examples of bipartite graphs with 6 vertices and 7 edges.
5. Draw a complete bipartite graph K1.3. K3.3 and K2.3.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
B. Complement of a Graph
The complement of a simple graph in which two vertices are adjacent if and only if they are not adjacent in
graph G, it is denoted by G. In other words, there is an edge between two vertices u and v if and only if there
is no edge between u and v in the original graph G. To determine the complement of a simple graph, we will
fill in all the missing edges to get a complete graph, and remove all the edges that were already there. Note
that is not the set complement of the graph; only the edges are complementary. Figure 10.26 shoes graph G1
and G2 and their complements G1 and G2. Note that the complement of a complete graph is a null graph.

The complement of complete bipartite graph is a graph having the following properties: no vertex in A
(black vertices) is adjacent to any vertex in B (white vertices); every vertex in A is adjacent to every vertex in
A; and every vertex in B is adjacent to every other vertex in B. Figure 10.27 shows graph K1.3 and K3.3 and
their complements. Observe that the complement of complete bipartite graphs is not connected.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
Supplementary Exercise 10.2B
1. Construct a simple graph and its complement having 6 vertices.
2. Construct the complete bipartite graph K5.3 and its complement.

C. Walks, Trails, Paths, Circuits, and Cycles


In this section, we will introduce additional concepts of graph theory. Some of the
concepts are not universally agreed upon terminology.
Given a graph G, a walk in G is a finite sequence of edges of the form v0 → v1 → v2 →
… → vn (or v0, e1, v2, e2, …, vn, en) in which any two consecutive edges are adjacent. We
call v0 the initial vertex (or starting vertex) and vn the terminal vertex (or end vertex) of the
walk. The length of walk is the number of edges in a walk. Any u-v walk u = v (and n > 1) is
called closed walk, otherwise the walk is called open. Let us consider Figure 10.28 a → b → c
→ d → e → f is a walk of length 5 from vertex a to vertex f, the initial vertex of the walk is a
and the terminal vertex is f
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

A trail is a walk with no repeated edges (the edges are distinct); while a path is a walk with no repeated vertices except possibly the
initial and terminal vertex (two vertices are distinct). A walk, path, or trail is called trivial if it has only one vertex and no edge. On the
other hand, a walk, path, or trail that is not trivial is called nontrivial. A nontrivial closed trail from a vertex v to itself is called circuit.
Let us consider Figure 11.28 a walk from b → c → d → e → f → d → h is a trail since there are no repeated edges (note that a repeated
vertex, is permissible like in the case of vertex d), while a walk from a → g → b → c → d → h → f is a path since there is no repeated
vertices.
Theorem 10.4: Let G be a graph and u, v be two vertices of G. If there is a walk from u to v, then there is a path from u to v.
A cycle is a cirvuit that does not contain any repetition except that the initial vertex and the terminal vertex (closed path such that n
≥ 3. A cycle of length k is called a k-cycle. A cycle is called even (odd) if it contains an even (odd) number of edges. Let us consider
Figure 10.29 the circuit a → b → c → d → h → g → f → a is a cycle or 7-cycle since it has a length of 7.
We summarize some important points concerning walks, trails, paths, circuits, and cycles as shown in table 10.2.

A graph is considered connected if and only if there is a path between each pair of vertices otherwise it is disconnected. Figure
10.30 shows that G1 is a connected graph, while G2 is disconnected graph. Notice that G 1 has 8 vertices and 8 edges, note that the
number of edges must be at least 7 edges (refer to Theorem 10.6). A graph that is disconnected contains two more pieces called
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

•  A disconnecting set is a connected graph G with the set of edges whose removal disconnects G. The set of edges whose
removal increases the number of components of G are called cut edges, while the removal of vertex and all edges incident
with it are called cut vertices (or articulation points). A cutset is defined to be a disconnecting set, no proper subset of
which is a disconnecting set. A bridge is a cutset with only one edge.
If G is connected, its edge connectivity (G) is the size of the smallest cutset in G. In other words, (G) is the minimum
number of edges that we need to remove in order to disconnect G. Let us consider Figure 10.31 if G1 is the graph then (G1)
= 2, corresponding to the cutset {e5, e6}. The sets are {e1, e2, e3, e4} and {e7, e8, e9}, while the set disconnecting is {e5,
e6}. Figure 11.31 shoes that G2 is the resulting graph after the removal of the disconnecting set {e5, e6}.

Another example is the graph G in Figure 10.32 where (G1) = 1, since {e5} is just a bridge. The graph G2 is the
resulting graph after removing the disconnecting set {e5}.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

Theorem 10.5: Let G be a simple graph with at most 2n vertices. If the degree
of each vertex is at least n, then the graph is connected.
Theorem 10.6: A connected graph with n vertices has at least n-1 edges.

Supplementary Exercise 10.2C


1. Find two distinct trails and paths of the graph in Figure 10.29 and give
their lengths.
2. Determine two distinct cycles of the graph in Figure 10.28.
3. Draw a connected and disconnected graph using 7 vertices.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
D. Isomorphism, Homeomorphism and Planarity of Graphs
Two graphs are isomorphic if there is a one-to-one correspondence between the vertices of both graphs such that the number of edges joining any
two vertices of G1 is equal to the number of edges joining the corresponding vertices of G2, (written G1 = G2, if G1 is isomorphic to G2), The
function F; V1 → V2 is called a graph isomorphism. Thus, an isomorphism is simply a rule associating vertices that preserves the edges joining the
vertices.

Consider the two graphs shown in Figure 10.33 are isomorphic under the correspondence f(a) → d, f(b) → e, f(c) → f, f(t) → x, f(u) → y, f(v) → z (it
can also be written as: a ‹–› d, b ‹–› e, c ‹–› f, t ‹–› x, u ‹–› y, v ‹–› z). We can conclude that two “unlabeled graphs” are isomorphic if we can assign
labels so that the resulting “labeled graphs” are isomorphic. Let’s take for example the graphs in Figure 10.34, if we label the vertices of G1 and G2 we
can establish that they are isomorphic. On the other hand, G1 and G2 are not isomorphic to G3.
In addition, two graphs are isomorphic to one another and must have the same number of vertices, edges, vertices of any given degree, cycles, and
cycles of any given size. Conversely, G1 and G2 are said to be different if G1 is not isomorphic to G2.

Theorem 10.7: Simple graphs G1 and G2 are isomorphic if and only for some ordering of their respective vertices, their adjacency matrices are equal.
The isomorphism of graphs can also be shown using adjacency matrix as noted from Theorem 10.7. Let us consider the graphs G1 and G2 of Figure
10.33, below are the adjacency matrices of the following graphs.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
Rearranging the rows and columns of the adjacency matrix for graph G2 as illustrated in the following adjacency matrices. It can be notice that the
adjacency matrix of G1 is similar to the adjacency matrix G1 is similar to the adjacency matrix G2. Thus we can say that It can be mapped as a one-to-one
correspondence of

A planar graph is a simple connected graph if it is possible to draw it on a plane such that no two edges of the graph intersect except possibly at a vertex
to which they are both incident. Any such drawing is a plane drawing or simply plane graph. The drawing is also referred to as embedding of the graph in
the plane.
A particular planar representation of a planar graph is called a map. A map divides the plane into a number of regions of faces. The graph G1 in Figure
10.35 is a planar graph since it is isomorphic to the plane graphs G2 and G3.

Two graphs are homeomorphic if both can be obtained from the same graph by a sequence of elementary subdivisions, in which a single edge uv is
replaced by two new edges uv-vx connecting to a new vertex v.
The graphs G2 and G3 of Figure 10.36 are homeomorphic because each can be obtained from graph G1 by sequence of elementary subdivisions. A
planar graph cannot be turned into nonplanar by elementary subdivisions, and a nonplanar graph cannot be turned into a planar graph. Homeomorphic
graphs are either both planar or both nonplanar.

Theorem 10.8: (Kuratowski Theorem) A graph is planar if and only if it contains


no subgraph homeomorphic to K5 and K13.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
E. Eulerian and Hamiltonian Circuit
Konigsberg is a city which was the capital of East Prussia (now is known as Kaliningrad in Russia). The city is
built around Pregel River where it joins another river. An island named Kniephof is in the middle of where the rivers
join. Figure 10.37 shows the seven bridges that connect the different parts of the city on both sides of the rivers and
the island.
People tried to find a way to walk all seven bridges without crossing a bridge twice, but no one could find a way
to do it. The problem came to the attention of Leonard Eular a Swiss mathematician. In 1735, he presented the
solution to the problem before the Russian Academy. He explained why crossing all seven bridges without crossing a
bridge twice was impossible.
Eular simplified the Konigsberg Bridge problem by representing each land mass as a vertex (represented as
vertices a, b, c, d in Figure 10.37) and each bridge as an edge. Figure 10.38 shows the graph representation of the
Konigsberg Bridge Problem. He said that anyone standing on land would have to have a way to get on and off.
Therefore, each land mass would need an even number of bridges. But in Konigsberg, each land mass had an odd
number of bridges with deg(a) = deg(c) = deg(d) = 3 and deg(b) = 5. This is why all seven bridges could not be
crossed without crossing one more than once. This is where the new field of mathematics graph theory originated.
A circuit in a graph that includes all the edges of the graph is called Euler circuit. Vertices may be repeated and the
route itself is called an Eulerian trail.

A graph G is Eulerian if there is an Euler circuit in G that involves every edge exactly once. A non-Eulerian graph
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT

If we denote vertices as a, b, c, d, and e to all the graphs of Figure 10.39 we could trace the Eulerian circuit and semi-Eulerian trail of
Figure 10.40. The Eulerian circuit on graph G1 is a → b → d → c → e → b → d → e → a → c → a (note that the circuit covers all the edges
once). The semi-Eulerian trail of graph G2is b → a → c → e → b → d → e → a → c → d. Observe that the trail in G2 starts and ends at odd
vertices. Graph G3 is neither Eulerian nor semi-Eulerian because there is no possible circuit or trail to cover all edges once.

Note that not every graph has an Eulerian path or circuit. In the Konigsberg Bridge Problem, it can solved by duplicating some edges
(Bridges) in the graph until an Euler circuit exists the process is called Eulerization. In order to eulerize a graph, edges are duplicated to
connect pairs of vertices with odd degree and giving them both even degree.
Consider the graph G1 of the Konigsberg Bridge Problem in Figure 10.41 it can be eulerized by determining the vertices with odd
degree such as a, b, c and d with degrees 3, 5, 3 and 3, respectively. Then, duplicating the edge ad, bd and cd, making all the degree of
vertices even such as deg(a) = 4, deg(b) = 6, deg(a) = 4, and deg(a) = 6. Now the graph G2 in Figure 10.43 contains an eulerian circuit.

Lemma 10.1: if G is a graph in which the degree of each vertex is at least 2, then G contains a cycle.
Theorem 10.9: A graph G is Eulerian if and only if every vertex in G has even degree.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
Corollary 10.4: A connected graph is semi-Eulerian if and only if it has exactly two vertices of odd degrees.
A Hamiltonian path (or traceable path) is a path that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian
circuit) is a cycle which visits each vertex exactly once and also returns to the starting vertex and the graph is called Hamiltonian
graph. It was named after an Irish mathematician Sir William Rowan Hamilton (1805-1865). On the other hand, a semi-
Hamiltonian graph is a graph that contains Hamiltonian path, but not a Hamiltonian cycle.
The graph of Figure 10.42 G1, G2 and G3 are Hamiltonian, semi-Hamiltonian and non-Hamiltonian, respectively. Take note
that Hamiltonian graph is a circuit that passes through each vertex once but does not need to pass through every edge, while semi-
Hamiltonian is a trail covering each vertex once does not need to cover each edge.
IF we denote a, b, c, and d of the graph in Figure 10.42 as shown in Figure 10.43 we could trace the Hamiltonian circuit and
Hamiltonian path. The Hamiltonian circuit on graph G1 is a → b → c → d → a (note that the circuit covers all the vertices and not
necessary all the edges). The semi-Hamiltonian path of graph G2 is d → a → b → c. Observe that the path covers all the vertices
but does not starts and ends in the same vertex. Graph G3 is neither Hamiltonian nor semi-Hamiltonian because there is no
possible circuit or path to cover all vertices once.

Theorem 10.10: A Hamiltonian graph has no cut-vertex.


Theorem 10.11: (Dirac’s Theorem) Let G be a simple graph with n vertices, where n > 2. If each vertex has degree at least n/2, the
graph G has a Hamiltonian cycle.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
Example 1: A tour guide is developing an itinerary for tourist in a certain province. She places to travel across
all the major roads shown on the following map. The itinerary she is developing need not necessary return to
the same tourist spot, so the trip can begin in any tourist spot. Is it possible for the tour guide to design an
itinerary that traverse all the road exactly at once?
Solution: We draw the map in to graph Figure 10.44
Note that a route needs to include all the roads but does not cover any road twice, which is an Euler path.
Observe that two vertices have odd degree, tourist site E and G. Since vertices E and G are vertices of odd
degree, the tour guide must start at one of these tourist sites. Thus, one Euler path is E → C → D → G → C →
B → E → A → B → F → G.
Example 2: The floor plan of an office is illustrated in Figure 10.45. Use a graph that represents the
floor plan, where vertices correspond to rooms and edges correspond to doorway. Is it possible to take
a stroll that passes through every doorway without going through the same doorway without going
through the same doorway more than once? If so, does it matter whether we return to the starting
point?
Solution: We can represent the floor plan by a graph, letting each room be a vertex. Then we draw an
edge between two vertices if there is a doorway between the two rooms, as shown in Figure 10.47
The graph in Figure 11.46 is equivalent to the given floor plan. If we want to tour the office and pass
through every doorway once, we need to find a path in the graph that uses every edge once. We need to
find an Euler path. Notice that the graph in Figure 10.46 contains two vertices with odd degree and the
others are even.
Thus, an Eular path exists, but not an Euler circuit (see Corollary 10.4). Furthermore, we must start as
a vertex of odd degree either room C or D. Therefore, the Euler path is C → B → A → G → B → E → F
→ E → D → E → C → D.
UNIT 10.2: GRAPHS AND EULER’S CIRCUIT
Supplementary Exercise 10.2E
1. Draw an Eulerian, semi-Eulerian, and non-Eulerian graph with 6 vertices.
2. Eulerize the graph G3 in Figure 11.34.
3. Construct a Hamiltonian and semi-Hamiltonian graphs with 6 vertices.
4. The floor plan of an office shown in Figure 11.47. Use a graph that represents the floor
plan, where vertices correspond to rooms and edges correspond to doorway. Is it possible
to take a stroll that passes through every doorway without going through the same
doorway more than once? If so, does it matter whether we return to the starting point?
UNIT 10.3: WEIGHED GRAPHS
This section covers tree and spanning tree to set as introduction to weighted graph and its application.
A. Tree
A tree is a mathematical structure that is a special kind of graph which has the following properties: (1) it is undirected; (2) it is
connected (each of the vertices is connected with a link to at least one other vertex); and (3) acyclic (there is only one route from any
vertex to any other vertex or has no cycle). Each edge connecting each pair of vertices is a bridge . On the other hand, a forest is a disjoint
union of trees. In other words, forest is a set of trees. It can also be noted that each component of forest is tree, and any tree is a connected
forest. We will denote T as tree and F as forest. Also the number of components of a graph G is denoted c(G).
Figure 10.48, Figure 10.49 and Figure 10.50 show graphs G1, G2 and G3, respectively. Graph G1 is an example of a tree, since it is
undirected, connected and acyclic. On contrary, graph G2 is undirected and connected but not acyclic (meaning there is a cycle within the
graph) thus it is not a tree. Lastly, graph G3 is undirected and acyclic but not connected, thus it is a forest. Recall that a forest is a
composition of trees, observe that G2 has trees or c(G) = 1, which is considered as a forest.

Let us consider the tree in Figure 10.48 and test Theorem 10.13. Notice that G1 contains no cycle with an edge of v-1 = 5-1 = 4; all
pairs of vertices contain an edge (or a bridge); there is only exactly one path from one vertex to another, and whenever we introduce a
UNIT 10.3: WEIGHED GRAPHS
Table 10.3 shows some examples of trees with their corresponding number vertices and edges. It can be observed that the
number of vertices is one more than the number of edges. Trees have many descriptions, and each contributes to the concrete
understanding of graphs. Theorem 10.13 forms some of the most useful descriptions.

Trees are also used in representing chemical structures such as Methane (CH4), Ethane (C2H6 and Butane (C3H8) on the left
and on the right are their respective tree representations as shown in Figure 11.51. The model molecules of hydrocarbons
represent each atom a vertex (Hyrdogen-H and Carbon-C) and each chemical bond by an edge.

Since a tree isomorphism preserves root and edge incidence, the level number (1) a vertex is a tree isomorphism invariant;
(2) paths from the root to the leaves is a tree isomorphism invariant; (3) levels in a tree (longest path) is a tree isomorphism
invariant; and (4) leaf descendants of a vertex and the level number of a vertex are both tree isomorphism invariants.
Theorem 10.15: Two trees are isomorphic if and only if they have the same (i) number levels and the same number of vertices
UNIT 10.3: WEIGHED GRAPHS
Let us consider the trees in Figure 10.52, notice that T1, T2, nad T3 have the same degree sequence of (1, 1, 1, 2, 3). Observe
also that there is a one-to-one correspondence between the vertices of the trees T1, T2 and T3 and the number of edges joining
any the vertices of T1 is equal to the number of edges joining the corresponding vertices of T2, the same with T1 and T3, and
T2 and T3. Hence, T1, and T2 and T3 are isomorphic. If we put a label on all of the vertices of the trees as shown in Figure
10.53, we can map T1 to T2, T1 to T3, and even T2 to T3 notice that it preserves the connectivity of the vertices to other
vertices.

On the other hand, the T1, T2, and T3 trees in Figure 10.54 have degree sequence of (1, 1, 2, 2, ,2) (1, 1, 1, 2, 3),and (1, 1, 1,
1, 4), respectively. Also, there is no one-to-one correspondence between the vertices of the trees of T1 to T2, T1 to T3, and T2 to
T3. Thus, T1, T2, and T3 are non-isomorphic.

Figure 10.55 shows the tree different chemical structures of Pentane (C3H12).
In general, the different structures associated with a fixed formula are referred as isomers,
UNIT 10.3: WEIGHED GRAPHS
Supplementary Exercise 10.3A
1. Construct a tree with 8 vertices such that 2 vertices are of degree 4.
2. Draw a forest with 3 components and 9 vertices.
3. Draw the chemical structure of Benzene (CnHn).
4. Construct an isomorphic tree using 6 vertices.
5. Show the isomers of C4H10 (Butane and Isobutene).
UNIT 10.3: WEIGHED GRAPHS
B. Spanning Tree
A spanning tree of a graph is a subgraph which is a tree and contains all vertices of the graph. In Figure 10.56, the graphs T1, and T2,
T3 and T4 represent a spanning tree for the graph G on the left. Observe that the spanning tree is not unique and any connected graph has
at least one spanning tree.

Example 1: Let us examine Figure 10.57. Given a graph G we can obtain a spanning forest like F1 and F2 as shown below. Generally, we
can obtain a number of different forests in given a graph as noted in Theorem 10.18.

Example 2: Find the number of spanning trees of the complete graph K3


Solution: Using Cayley’s theorem where v = 3.
V1-2 = 33-2 = 33 =3
Thus, there are 3 sub-trees for complete graph K3. Graphically Figure 10.58 shows the 3 different sub-trees T1, T2 and T3 of K3.
UNIT 10.3: WEIGHED GRAPHS
Example 3: show that Theorem 10.20 and Lemma 10.2 holds using the Tree T1 in Figure 10.59.
Solution: Examine that if we draw an edge to vertices b and d, it creates a cycles a → b → d → a as shown in the graph G1 in Figure 10.59.
Even when we introduce an edge to vertices c and d, it also produces a cycle of a → c → d → a as reflected in graph G2 in Figure 10.59.
We can say that a cycle is created whenever an edge is being introduced in any given tree. Thus, through in indirect proof we have shown that Theorem 10.20
hold.
In a case that if we delete an edge ad and add an edge cd, the resulting graph is also a tree T2 as shown in Figure 10.59, we can also conclude that Lemma 10.2 is
true.

There are three known personalities who made a significant contribution in the field of graph theory, specifically on spanning tree namely: Robert Clay Prim,
Joseph Bernard Kruskal and Edsger W. Dijkstra.
Robert Clay Prim developed Prim’s algorithm in 1957 which is a greedy algorithm that determines a minimum spanning tree for a connected weighted
undirected graph. The algorithm finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is
minimized. The same algorithm was developed by Vojtech Jarnik a Czech mathematician in 1930 and rediscovered by Edsger W. Dijkstra in 1959.The algorithm
sometimes called the DJP algorithm (or Jarnik algorithm or Prim-Jarnik algorithm).
Joseph Bernard Kruskal (1928-2010) is an American mathematician, statistician, computer scientist and psychometrician; he introduced the Kruskal’s
Algorithm for computing the Minimal Spanning Tree (MST of weighted tree. The Kruskal’s algorithm first orders the edges by weight and then proceeds through
the ordered list adding an edge to the partial MST provided that adding the new edge does not create a cycle. Minimal spanning trees have applications to the
construction and pricing of communication network.
Edgar W. Dijkstra (1930-2002), a Dutch computer scientist, conceived the Dijkstra’s Algorithm in 1956 which was later published in 1959. The algorithm is a
graph search algorithm that determines the single-source shortest-path problem for a graph producing a shortest path tree. Dijkstra’s Algorithm is frequently used
in routing and as a subroutine in other graph algorithms. It is a greedy algorithm and similar to Prim’s algorithm. Dijkstra’s Algorithm starts at a source vertex
and it grows a tree that spans all vertices reachable form shortest-path weights from the source vertex.
UNIT 10.3: WEIGHED GRAPHS
Example 4: Given a weighted graph G in Figure 10.60, find
spanning tree T such that the sum of the weights of the edges is
the smallest possible using Prim’s and Kruskal’s algorithms.
Solution: a. We will first evaluate the minimum spanning tree
solution of the given tree of Figure 10.60 using Prim’s Algorithm.
UNIT 10.3: WEIGHED GRAPHS

The Prim’s Algorithm computes the following sequence of partitions:

Observe that all the vertices are already connected and thus we already established the minimum spanning tree. Figure 11.61
shows the spanning tree with total weight of 3+6+7+3+2+8=29
b. This time we will determine the minimum spanning tree solution using Kruskal’s Algorithm.
UNIT 10.3: WEIGHED GRAPHS
UNIT 10.3: WEIGHED GRAPHS
The Kruskal’s Algorithm computes the following sequences of partitions:

After we already established a tree, we then solve for the total weight of the minimum spanning tree. 3+6+7+3+2+8=29
Figure 10.62 shoes the minimum spanning tree with the corresponding weight in each edge.

Theorem 10.21: Let G be any weighted connected graph. Each of Kruskal’s Algorithm and Prim’s Algorithm yields a
minimum spanning tree for G.
Thoerem 10.22: Let G be a weighted connected graph and v a vertex of G. Dijkstra’s Algorithm yields a shortest path tree
for G form v.
UNIT 10.3: WEIGHED GRAPHS
Supplementary Exercise 10.3B
1. Draw a forest F with c(G)=3 and 8 vertices.
2. Construct a spanning tree of a cycle graph C5.
3. Find the number of spanning trees of the complete graph K4.
4. Determine the minimum spanning tree of Figure 10.63 using Prim’s and Kruskal’s algorithms.
UNIT 10.3: WEIGHED GRAPHS
C. Weighted Graph

A lot of problems can be presented using graphs with weights assigned to their edges. The weights could
represent the distance between two locations, the travel time, the travel cost, etc. It is important to note that
the distance between vertices in a graph does not necessarily correspond to the weight of an edge. One good
example is the problem involving distances which can be presented by assigning distances between cities.
Let say, for example, the cities in the National Capitol Region such as Manila City, Quezon City, Caloocan,
Makati City, Pasig City, Parañaque City and others. The cities will serve as the vertices and the distances are
the weight of the edges. Such graphs are called weighted graphs since it contains a number to its edge.
This section covers some applications of graph theory such as the Shortest Path Algorithm, Travelling
Salesman Problem, and the Chinese Postman Problem.
UNIT 10.3: WEIGHED GRAPHS
There are several ways in determining the shortest path of any given weighted graph. This text specifically covers the simplest way to
do it and it is by the way of inspection. Let us consider the example below to illustrate on how to determine the shortest path.

Example 1: Suppose we have a map of the form shown in Figure 10.64, which the letters a, b, c, d, e, x refer to towns that are connected
by roads. If the length of these roads are as marked, what is the length of the shortest path form a to x?
Solution: Note that the answer can be obtained by taking any path from a to x calculating its length. Figure 10.65 below illustrates the
three possible paths from a to x and their total lengths.

The travelling salesman problem can be reformulated in terms of weighted graphs. In order to solve the travelling salesman problem,
we have to find a Hamiltonian cycle of least possible total weights in a weighted complete graph. One possible algorithm is to calculate
the total distance for all possible Hamiltonian cycles, but this is far more complicated for more than 5 vertices. Let us consider the
travelling salesman problem in the next example.
UNIT 10.3: WEIGHED GRAPHS
Example 2: A travelling salesman whishes to visit several given cities and return to his starting point,
covering the least possible total distance as shown in Figure 10.66.

Solution: We have to identify the list all the possible cycles form initial vertex a to terminal vertex a
including the total distance travelled.

The shortest possible route is a → b → c → d → e → f → a, given a total distance of 22, as can be seen by
inspection
UNIT 10.3: WEIGHED GRAPHS
The Chinese Postman Problem (CPP) is to find a shortest closed path or circuit that
visits every edge of a connected undirected. If the graph traveled has an Eulerian
circuit, then the circuit services is the ideal solution. It was originally studied by a
Chinese mathematician Mei-Ku Kuan in 1962 and Alan Goldman of the US National
Bureau of Standards, first coined the name “Chinese Postman Problem.”
Let us consider the example below to illustrate the Chinese postman problem.
Example 3. A postman wishes to deliver his letters, covering the least possible distance
and returning to his starting point. He must traverse each road in his route at least
once, but should avoid covering too many roads more than once. Figure 10.67 shows
the six destinations including the distances from one vertex to another.
Solution: Inspect if the graph contains an Eulerian circuit which is the required type. If
the graph is not Eulerian, then the problem is more difficult to solve. To show the ideas
involved, let us focus on our example, observe that there are exactly two vertices of
odd degrees in Figure 10.67. Thus, the graph is a semi-Eulerian which means that it
contains an Eulerian trail.
Notice that vertices c and f are the only vertices with odd degrees. We can find a trail
from vertex c to vertex f covering each edge exactly once. In order to return to the
initial vertex we need to find the shortest part form vertex c to vertex f.
The solution to the problem is taking the shortest path c → b → a → f with 5+2+3 = 10
including the original trail of the original graph, giving a total distance of 10+48 =58.
UNIT 10.3: WEIGHED GRAPHS
Solution: We can represent the information using weighted graph as shown in Figure 10.69 with vertices representing the countries
and each edge labeled with the price of the flight between the corresponding countries.
We start at Philippines and travel along the edge with the smallest weight ₱ 3,600, to Singapore. The edge of smallest weight
leaving Singapore is the edge to Thailand (₱ 2,100). Form Thailand, the edge of smallest weight is the edge to Vietnam (₱ 3,500).
From Vietnam, the edge of smallest weight is the edge to Philippines, of weight ₱ 4,400. However, we cannot use this edge,
because it would bring us to Philippines. We can take the smallest edge to Malaysia (₱ 6,500). Next is to take flight to Indonesia
with the smallest edge weight of ₱2,500. Lastly, we take a flight to Philippines (₱ 6,800)

The total weight of the edges and thus the total airfare for the Southeast Asian (Philippines → Singapore → Thailand → Vietnam →
Malaysia → Indonesia → Philippines) trip, is ₱ 3,600+ ₱ 2,100+ ₱ 3,500+ ₱ 6,500+ ₱ 6,800 = ₱ 25,000.
Supplementary Exercise 10.3C
1. Determine the shortest path from vertex a to vertex d in Figure 10.66.
2. A DSWD representative of a barangay wishes to visit several streets and return to his starting point, covering the least possible
UNIT 10.4: EULER’S FORMULA
Euler noticed that all planar representation of a graph splits the plane into the same faces/regions. He discovered a relationship among the number of regions, the
number of vertices, and the number edges of a planar graph.
Theorem 10.23: Theorem on the Number of Vertices and Edges: For a simple, connected, planar graph with v vertices and e edges.
1. If the planar representation divides the plane into r regions/faces then v-e + r=2.
2. If v≥ 3, then e ≤ 3v – 6.
3. If v ≥3, and there are no cycles of lengths 3, then e ≤ 2v – 4.
Corollary 10.7: If G is a plane with c(G) connected components then v-3 +r=1 + c(G).
Theorem 10.24: The graph K5 and K33 are nonplanar.
We can use Theorem 10.23 to prove that certain graphs are not planar. Notice that if every cycle of a finite planar G contains at least n edges, since each edge occurs on
exactly two faces/regions, we have the inequality kr ≤ 2e.
Example1: Determine whether the following graphs are planar: (a) cube, (b) K3, and (c) K33,
Solution: a. The graph of the cube has the following: v=8, e=12, and r=6. Applying the rules on Theorem 10.23 to determine whether the graph of a cube is planar.

Since all the rules were satisfied we can say that the cube is planar. We can also verify from Figure 10.70 that graph G1 can be drawn as graph G2.

b. The graph K3 is a loop-free and v=5 and e = 10.


Rule 1: v-e+r=2 5 -> 10 + r = 2 -> r =7
By the inequality kr ≤ 2e -> 3(7) ≤ 2(10) -> 3r ≤ 2e which is a contradiction, K5is nonplanar.
Rule 2: 3v-6=3(5)-6=15-6=9<10=e
Since the solution contradicts Theorem 10.23 No. 2: e ≤ 3v-6, we can say that the graph K5 is nonplanar. Geometrically, Figure 10.71 shows that K5 cannot be drawn
UNIT 10.4: EULER’S FORMULA

c. The graph K33 has v=6, e=9.

Since we know that K33 is nonplanar(contradiction to e ≤ 2v -4) as reflected in Figure 10.72 of graph G2. Note that the graph K33 cannot
be drawn in such a way that no edges will intersect.

Example 2. Verify Euler’s Formula for the planar graph in Figure 10.73.
Solution: There are ten edges (e=10), seven vertices (v=7,) and five regions (including the infinite space, r=5) in the graph in Figure
10.74, we get

Thus, the graph is planar.


Example 3: The graph in Figure 10.75 shows that Corollary 10.7 holds.
UNIT 10.4: EULER’S FORMULA
Solution:
There are thirteen edges (e-13),twelve vertices (v=12), five regions (including the infinite
space r=5), there are three components c(G) = 3 in the graph in Figure 10.76, we get

Thus, v-e + r =1 + c(G) holds.


Supplementary Exercise 10.4
1. Determine whether the platonic solid “octahedron” is a planar graph.
2. Verify Euler’s Formula for the planar graph in Figure 10.66.
UNIT 11.5: GRAPH COLORING
The map shown in Figure 10.77 is the National Capital Region and the partition in
terms of cities. Let say, for example, we color each area by different color, we will be
needing 18 different colors. How about if we use a minimal number of colors where no
two neighboring cities will have the same color? So, what is the least number of colors do
we needs. This section explores the idea behind graph coloring and its connection to graph
theory.
A graph coloring is an assignment of labels, called colors, to the vertices of a graph G
such that no two adjacent vertices are colored using same color. It is also referred as
vertex coloring. The other graph coloring problems like edge coloring in which no vertex
is incident to two edges of same color. Another is face coloring where a geographical map
coloring can be transformed into vertex coloring.
The chromatic number of a graph G, written as ꭓ(G) is the smallest number of colors
needed to color G. A graph G is called k-colorable if there exists a graph coloring on G
with k colors and satisfying the requirement that adjacent vertices are colored with
different colors. If a graph is k-colorable, then it is n-colorable for any n>k. A graph has a
chromatic number that is at least as large as the chromatic number of any of its subgraphs.
A graph has a chromatic number that is at most one larger than the chromatic number of a
subgraph containing only one less vertex.
UNIT 11.5: GRAPH COLORING
•  A graph G is called critical if ꭓ(G-v)< ꭓ(G) for all v
V(G), Specifically, a graph G is called k-critical and ꭓ(G) = k. Some
applications of graph coloring problem are making schedule or time table, mobile frequency assignment, Sudoku, register allocation,
bipartite graphs, map coloring among others. We will be using R, B, Y, W, and O to denote that the vertex is color red, blue, yellow,
white, and orange, respectively for this section.
The graph in Figure 10.78, shows that graph G1 is not 2-colorable, graph G2 is 3-colorable, and G3 is 4-colorable. The chromatic
number of the given graph is ꭓ(G) = 3.

Let graph G is a graph. A k-coloring of G partitions the vertex set v into set v1, v2, v3, …, vk where each set v, is an independent
set. Note that an independent set is when no two vertices in the set are adjacent. The independent sets v1, v2, v3, …, vk are called color
classes.

Example 1: Find the chromatic number of a complete graph K5.


Solution: In the graph K5 in Figure 10.79, note that the graph contains 5 vertices and every vertex is adjacent to every other vertex. In
order to map up the graph coloring we need to take note that no two vertices can have the same color for each vertex. Thus, we can
conclude that ꭓ(K5) = 5.
UNIT 11.5: GRAPH COLORING
Example 2: Determine the chromatic number of a Petersen graph.
• Solution: The Petersen graph in Figure 10.80 has a chromatic number of ꭓ(G)=3.

Example 3: Determine the chromatic number of a cycle graph with 5 and 6 vertices
Solution: The cycle graph C5 in Figure 10.81 has a chromatic number of ꭓ(C5) = 3 and C6 has ꭓ(C6)=2.

It can be generalized that Cn(n≥3): If n is even, ꭓ(Cn)=2; if n is odd, ꭓ(Cn)=3.


Example 4: Determine the color classes of the Petersen graph in Figure 10.80.
Solution: Assigning the vertices v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 to the graph.
UNIT 11.5: GRAPH COLORING
Regrouping the vertices with respect to groups red, blue and yellow. Thus, the color classes are
Red = {v1, v2, v3, v4}
Blue= {v5, v6, v7}
Yellow = {v8, v9, v10}
Example 5: How can the departmental examination at a certain school be scheduled so that no student has two exams at the same time? Subjects that have
the same schedule are indicated with an X in the table below.

Solution: We can represent the given information by a graph. Each subject is represented by a vertex and an edge connecting the vertices corresponds to
common student in the course they represent. Each slot for the departmental examination is represented by a different color. A schedule of the examination
corresponds to a coloring of the associated graph.
Since the chromatic graph of this graph is 3, three time slots are needed.
A coloring of the graph using three colors and the associated schedule are
shown in Figure 10.83.

Each color corresponds to a time schedule, so one scheduling is


First Time Period: 2, 7
Second Time Period: 1, 4, 5
Third Time Period: 3, 6, 8
UNIT 11.5: GRAPH COLORING

Supplementary Exercise 10.5


1. Find the chromatic number of the “wheel of order six”.
2. Determine the chromatic number of the Konigsberg Bridge graph.
3. Determine whether the graph in Figure 11.84 is 2-colorable.
4. Eight different office committees want to schedule a meeting on the last day of July. Some committee members
belong to more than one of these committees, so committees that share members cannot meet at the same time.
How many different time schedules are required so that members can attend all meetings?

You might also like