Math 1 Module 11
Math 1 Module 11
Math 1 Module 11
11111
MODULE 11
LEARNING OUTCOMES
General Objectives
The purpose of this module is to introduce students to Graph Theory
Specific Objectives
As a result of this lesson, students will be able to:
1. Define and identify different types of graph.
2. Categorize and distinguish graphs based on its properties.
3. Apply the knowledge on graphs in programming and other related works.
Introduction
Graph Theory was first explored and systematically investigated by D. König in the
1930’s (Gardner, 1984,). The word "graph" has more than one meanings in mathematics.
Graph commonly refers to a function graph or "graph of a function," and usually
represented by a plot.
Definition of Graph
A graph G consists of a finite nonempty set V of objects called vertices and a set
E of 2-elements subsets of V called edges. The sets V and E are the vertex set and
edge set of G, respectively. So a graph G is an ordered pair of two sets V and E. For
this reason, some write G =(V,E). At times, it is useful to write V(G) and E(G) rather than
V and E to emphasize that these are the vertex and edge sets of a particular graph G.
Although G is the common symbol to use for a graph, we also use F and H as well as G’,
G’’ and G1, G2, etc. Vertices are sometimes called points or nodes and edges are
sometimes called lines. Two graphs G and H are equal if V(G)=V(H) and E(G)=E(H), in
which case we write G=H.
A graph G = (V, E) consists of a (finite) set denoted by V, or by V(G)
if one wishes to make clear which graph is under consideration, and
a collection E, or E(G), of unordered pairs {u, v} of distinct elements
from V. Each element of V is called a vertex or a point or a node, and
each element of E is called an edge or a line or a link.
Formally, a graph G is an ordered pair of disjoint sets (V, E), where
E = V × V. Set V is called the vertex or node set, while set E is the
edge set of graph G.
It is common to represent a graph by a diagram in the plane where the vertices are
represented by points (small circles-open or solid) and whose edges are indicated by the
presence of a line segment or curve between the two points in the plane corresponding
to the appropriate vertices. The diagram itself is then referred to as a graph.
Example 1:
G:
Example 2:
Adjacency List
a: b d
b: a c
c: b d e
d: a c e
e: c d
Adjacency Matrix
a b c d e
a 0 1 0 1 0
b 1 0 1 0 0
c 0 1 0 1 1
d 1 0 1 0 1
e 0 0 1 1 0
Math of Graphs
Find:
1. Vertices
2. Edges
3. Determine the order, size and degree of its vertices
4. Make an adjacency list and matrix
1. .V(G)= {a, b, c, d, e}
2. E(G) = {ab, ac, ad, bc, cd, ce, de}
3. |V|=5, m=7, d(a)=3, d(b)=2, d(c)=4, d(d)=3, d(e)=2
4. Adjacency List
a: b c d
b: a c
c: a b d e
d: a c e
e: c d
Adjacency Matrix
a b c d e
a 0 1 1 1 0
b 1 0 1 0 0
c 1 1 0 1 1
d 1 0 1 0 1
e 0 0 1 1 0
Math of Graphs
EXERCISE No. 1
1. Type Text Consider the set S={ 2,3,5,8,13,21} of six specific Fibonacci
numbers. There are some pairs of distinct integers belonging to S whose
sum or difference (in absolute value) also belongs to S, namely, {2,3},
{2,5}, {3,5}, {3,8}, {5,8}, {5,13}, {8,13}, {8,21}, and {13,21}.
a. Make a more visual way of identifying these pairs using
V(G)= { 2,3,5,8,13,21} and E(H)={ {2,3}, {2,5}, {3,5}, {3,8}, {5,8}, {5,13},
{8,13}, {8,21},{13,21}}
b. Determine the order, size and degree of its vertices
c. Make an adjacency list and matrix
Types of Graphs
There are many types of graphs based on the sequence or movement from one
vertex to another. Here are the examples.
Walk
A u-v walk W in G is a sequence of vertices in G, beginning with u and ending at
v such that consecutive vertices in the sequence are adjacent, that is we can express W
as 𝑾: 𝒖 = 𝒗𝟎 , 𝒗𝟏 , … , 𝒗𝒌 = 𝒗 where 𝒌 ≥ 𝟎 and 𝒗𝒊 and 𝒗𝒊+𝟏 are adjacent for
𝒊 = 𝟎, 𝟏, 𝟐, … , 𝒌 − 𝟏
a
b e
c d
W1: a-b-d-a-b-c
W2: a-b-c-d-e-b
W3: a-b-c-d-e
W4: a-b-c-d-e-b-d
Math of Graphs
Simply, length of a walk is one less than the number of occurrences of vertices in
the walk.
A walk of length 0 is a trivial walk.
W: v is a trivial walk
Trail
A u-v trail in a graph G to be a u-v walk in which no edge is traversed more than
once.
a
e
b
d
c
T: a-b-c-d-e-b-d
An a-d trail in the graph G, notice that this trail T repeats the vertex b and d, which
is perfectly permissible. Although the definition of a trail stipulates that no edge can be
repeated, no such condition is placed on vertices.
Path
A u-v walk in a graph in which no vertices are repeated is a u-v path. While the a-
d trail T above is not an a-d path in the graph G since the vertices b and d are repeated.
Circuit
C: a-b-c-d-e-b-d-a
Cycle
A circuit that repeats no vertex, except for the first and last, is a cycle. A k-cycle is
a cycle of length k. A 3-cycle is also referred to as a triangle. A cycle of odd length is
called odd cycle; while not surprisingly, a cycle of even length is called an even cycle.
If a vertex of a cycle is deleted, then a path is obtained. This is not necessarily true
for circuits, however.
EXERCISE No. 2
For the graph W of the figure in the next page, give an example of each of the
following or explain why no such examples exists.
W: a M:
r s t
b e u v w
x y z
d
c
EXERCISE No. 3
For the graph M of the figure above give an example of each of the following
or explain why no such examples exists.
Connected Graphs
If G contains a u-v path, then u and v are said to be connected and u is connected
to v ( and v is connected to u). So, u and v are connected only means that there is some
u-v path in G; it does not say that u and v are joined by an edge. Of course, if u is joined
to v, then u is connected to v as well. A graph G is connected if every two vertices of G
are connected, that is, if G contains a u-v path for every pair u,v of distinct vertices of G.
G is connected if and only if G contains a u-v walk for every pair u,v of vertices of
G. Since every vertex is connected to itself, the trivial graph is connected. A graph G that
is not connected is called disconnected.
Regular Graphs
If deg v = r for every vertex v of G, where 0 r n – 1, then G is r- regular or
regular of degree r.
The following are the only regular graphs of order 4.
Math of Graphs
2 2 2
1
4 4 4
2 4
1 1 1
3 3 3 3
0-regular 1-regular 2-regular 3-regular
EXERCISE No. 4
1. Vertices
2. Edges
3. Order, size and degree of its vertices
4. Adjacency list and matrix
5. 1-7 walk of length 7
6. 1-6 trail that is not a 1-6 path
7. 1-4 path of length 5
8. A circuit of length 7
9. A cycle of length 5
10. Trivial walk
EXERCISE No. 5