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

Graphs and Their Applications: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook

1. The document describes how graphs can be used to model real-world problems. It gives examples of using graphs to model map coloring, frequency assignment, and supplying gas to an area. 2. A graph consists of vertices and edges. Real-world objects are represented as vertices and relationships between objects are represented as edges. 3. The first problem discussed is map coloring, where countries are vertices and shared borders are edges. Assigning colors with no adjacent vertices having the same color models coloring a map.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Graphs and Their Applications: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook

1. The document describes how graphs can be used to model real-world problems. It gives examples of using graphs to model map coloring, frequency assignment, and supplying gas to an area. 2. A graph consists of vertices and edges. Real-world objects are represented as vertices and relationships between objects are represented as edges. 3. The first problem discussed is map coloring, where countries are vertices and shared borders are edges. Assigning colors with no adjacent vertices having the same color models coloring a map.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Chapter 1

Graphs and Their Applications

1.1 Introduction

A graph consists of a set of vertices and set of edges, each joining two ver-
tices. Usually an object can be represented by a vertex and a relationship
between two objects is represented by an edge. Thus a graph may be used
to represent any information that can be modeled as objects and relation-
ships between those objects. Graph theory deals with study of graphs. The
foundation stone of graph theory was laid by Euler in 1736 by solving a
puzzle called Königsberg seven-bridge problem. Königsberg is an old city in
Eastern Prussia lies on the Pregel river. The Pregel river surrounds an is-
land called Kneiphof and separates into two brances as shown in Fig. 1.1(a)
where four land areas are created: the island A, two river banks B and C ,
and the land D between two branches. Seven bridges connect the four land
areas of the city. It is said that the people of Königsberg used to entertain
themselves by trying to devise a route around the city which would cross
each of the seven bridges just once. Since their attempts had always failed,
many of them beleived that the task was impossible, but there was no proof
until 1736. In that year, one of the leading mathematician of that time,
Leonhard Euler published a solution to the problem that no such walk is
possible. He not only dealt with this particular problem, but also gave a
general method for other problems of the same type. Euler constructed

1
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

2 Basic Graph Theory

a mathematical model for the problem in which each of the four lands A,
B, C and D is represented by four points and each of the seven bridges is
represented by a curve or a line segment as illustrated in Fig. 1.1(b). The
problem can now be stated as follows: Beginning at one of the points A, B,
C and D, is it possible to trace the figure without traversing the same edge
twice? The matematical model constructed for the problem is known as a
graph model of the problem. The points A, B, C and D are called vertices,
the line segments are called edges, and the whole diagram is called a graph.

A
D

(a)

A D

C
(b)

Fig. 1.1 The graph model for Königsberg bridges.

Before presenting some applications of graphs we need to know some


terminologies. A graph G is a tuple (V, E) which consists of a finite set V of
vertices and a finite set of edges; each edge is an unordered pair of vertices.
The two vertices associated with an edge e is called the end-vertices of e.
We often denote by (u, v), an edge between two vertices u and v. We also
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graphs and Their Applications 3

denote the set of vertices of a graph G by V (G) and the set of edges of G
by E(G). Let e = (u, v) be an edge of a graph G. Then the two vertices u
and v are said to be adjacent in G and the edge e is said to be incident to
the vertices u and v. The vertex u is also called a neighbor of v in G and
vice versa. The graph in Figure 1.2(b) has six vertices A, B, C, D, E and
F, and ten edges. Vertices A and B are end vertices of edge (A,B). So A
and B are adjacent. Vertices B, C and F are the neighbors of the vertex A.

1.2 Applications of Graphs

Graphs have applications in almost all branches of science and engineering.


In this section we will see applications of graphs in modeling some real
world problems.

1.2.1 Map Coloring

Given a map containing several countries, we are asked to color the countries
using different colors so that no two countries with a boundary line in
common share the same color. Of course, our objective will be to use
minimum number of colors. Such a problem can easily be modeled by a
graph, as follows. We represent each country by a vertex and add an edge
between two vertices if the two countries corresponding to the vertices share
a boundary, as illustrated in Figure 1.2 where the Figure ??(b) illustrates
the graph model for the map in Figure 1.2(b). Now the problem becomes
a graph problem which asks to color the vertices of the graphs using the
minimum number of colors so that two adjecent vertices get different colors.
The vertices of the graph in Figure 1.2(b) are colored with four colors and
hence the regions of the map in Figure 1.2(b) can be colored with four
colors.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

4 Basic Graph Theory

F F 1

A E
C 2 E
A 2
3
B
D
C
D
B
4 1
(a) (b)

Fig. 1.2 (a) A map and (b) a graph model for map coloring.

1.2.2 Frequency Assignment

A communication engineer is going to assign frequencies to several trans-


mitters. Due to the physical locations of the transmitters, some of the
transmitter pairs are in the range of interference. Assume that there are
n transmitters and that n frequencies {1, 2, · · · , n} will be assigned to the
transmitters such that no two transmitters are assigned the same frequency,
and if two transmitters are in interference range then the difference between
their assigned frequencies should be as large as possible. We can easily de-
velop a graph model of this problem as follows. We construct a graph G by
representing each transmitter by a vertex of G and add an edge between
two vertices u and v of G if the transmitters corresponding to vertices u
and v are in interference range. Now the frequency assignment problem be-
comes the problem of labeling the vertices of G by 1, 2, · · · , n such that one
label is used for exactly one vertex by keeping the difference of the labels
of two end vertices of an edge is as large as possible. Five transmitters A,
B, C, D, E with their transmission range indicated by circles are shown in
Figure 1.3(a) and the graph model is shown in Figure 1.3(b). In the graph
model, there is an edge between A and B since their transmission range
overlap, i.e., they are in the range of interference. Similarly other edges
are added in the graph. Obseve that the frequencies are assigned to the
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graphs and Their Applications 5

vertices in such a way that the minimum difference of two adjacent labels
is 2.

E
A

(a)

4 1 3 5 2

A 3 B 2 C 2 D 3 E
(b)

Fig. 1.3 (a) Transmitters with their transmission range, (b) a graph model with fre-
quency assignment.

1.2.3 Supply Gas to a Locality

A gas company wants to supply gas to a locality from a single gas source.
They are allowed to pass the underground gas lines along the road network
only, because no one allows to pass gas lines through the bottom of his
building. The road network divides the locality into many regions as illus-
trated in Figure 1.4(a), where each road is represented by a line segment
and a point at which two or more roads meet is represented by a small
black circle. A point at which two or more roads meet is called an intersec-
tion point. Each region is bounded by some line segments and intersection
points. These regions need to be supplied gas. If a gas line reaches an
intersection point on the boundary of a region, then the region may receive
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

6 Basic Graph Theory

gas from the line at that intersection point. Thus the gas lines should reach
the boundaries of all the regions of the locality. Gas will be supplied from
a gasfield which is located outside of the locality and a single pipe line will
be used to supply gas from the gasfield to an intersection point on the outer
boundary of the locality.

gas field

(a) (b)

Fig. 1.4 (a) A locality and (b) a gas network.

The gas company wants to minimize the establishment cost of gas lines
by selecting the roads for laying gas lines such that the total length of the
selected roads is minimum. Since gas will be supplied from the gasfield using
a single line to the locality, the selected road network should be connected
and contains an intersection point on the outer boundary of the locality.
Thus the gas company needs to find a set of roads that induces a connected
road network, supply gas in all the regions of the locality and the length of
the induced road network is minimum. Such a set of roads is illustrated by
thick lines in Figure 1.4(b).
The problem mentioned above can be modeled using a “plane graph.”
A graph is planar if it can be embedded in the plane without edge crossings.
A plane graph is a planar graph with a fixed planar embedding in the plane.
A plane graph divides the plane into connected regions called faces. Let
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graphs and Their Applications 7

G = (V, E) be an edge weighted connected plane graph, where V and E


are the set of vertices and edges, respectively. Let F be the set of faces
of graph G. For each edge e ∈ E, w(e) ≥ 0 is the weight of the edge e
of G. A face-spanning subgraph of G is a connected subgraph H induced
by a set of edges S ⊆ E such that the vertex set of H contains at least
one vertex from the boundary of each face f ∈ F of G [PR10]. Figure
1.5 shows two face-spanning subgraphs drawn by thick lines where the cost
of the face-spanning subgraph in Figure 1.5(a) is 22 and the cost of the
face-spanning subgraph in Figure 1.5(b) is 17. Thus a plane graph may

4 4
5 5
4 4
2 2
7 6 6
3 3 2 3 3 2
4 4
2 3 6 6
3 2 3 3
4 2 3 2
2 5 5
6 6 2
4 4
4 2 2
4
3 3
5 5
4 4

(a) (b)

Fig. 1.5 A simple graph with (a) a face-spanning subgraph of cost 22 and (b) another
face-spanning subgraph of cost 17.

have many face-spanning subgraphs whose costs are different. A minimum


face-spanning subgraph H of G is a face-spanning subgraph of G, where

w(e) is minimum, and a minimum face-spanning subgraph problem asks
e∈S
to find a minimum face-spanning subgraph of a plane graph. If we represent
each road of the road network by an edge of G, each intersection point by a
vertex of G, each region by a face of G and assign the length of a road to the
weight of the corresponding edge, then the problem of finding a minimum
face-spanning subgraph of G is the same as the problem of the gas company
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

8 Basic Graph Theory

mentioned above. A minimum face-spanning subgraph problem often arises


in applications like establishing power transmission lines in a city, power
wires layout in a complex circuit, planning irrigation canal networks for
irrigation systems etc.

1.2.4 Floorplanning

Graph modeling have applications in VLSI floorplanning as well as archi-


tectural floorplaning [NR04]. In a VLSI floorplanning problem, an input is
a plane graph F as illustrated in Fig. 1.6(a); F represents the functional
entities of a chip, called modules, and interconnections among the modules;
each vertex of F represents a module, and an edge between two vertices of
F represents the interconnections between the two corresponding modules.
An output of the problem for the input graph F is a partition of a rect-
angular chip area into smaller rectangles as illustrated in Fig. 1.6(d); each
module is assigned to a smaller rectangle, and furthermore, if two modules
have interconnections, then their corresponding rectangles must be adja-
cent, that is, must have a common boundary. A similar problem may arise
in architectural floorplanning also. When building a house, the owner may
have some preference; for example, a bed room should be adjacent to a
reading room. The owner’s choice of room adjacencies can be easily mod-
eled by a plane graph F , as illustrated in Fig. 1.6(a); each vertex represents
a room and an edge between two vertices represents the desired adjacency
between the corresponding rooms.
A “rectangular drawing” of a plane graph may provide a suitable solu-
tion of the floorplanning problem described above. (In a rectangular draw-
ing of a plane graph each vertex is drawn as a point, each edge is drawn as
either a horizontal line segment or a vertical line segment and each face in-
cluding the outer face is drawn as a rectangle.) First, obtain a plane graph
F ′ by triangulating all inner faces of F as illustrated in Fig. 1.6(b), where
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graphs and Their Applications 9

b b
b
a f a f
a b
f
e c a f
e e
g e
g g d g c
c c
d
d d
(a) (b) (c) (d)

Fig. 1.6 (a) Graph F , (b) triangulated graph F ′ , (c) dual-like graph G, and (d) rect-
angular drawing of G.

dotted lines indicate new edges added to F . Then obtain a “dual-like”


graph G of F ′ as illustrated in Fig. 1.6(c), where the four vertices of degree
2 drawn by white circles correspond to the four corners of the rectangular
area. Finally, by finding a rectangular drawing of the plane graph G, obtain
a possible floorplan for F as illustrated in Fig. 1.6(d).

1.2.5 Web Communities

The World Wide Web can be modeled as a graph, where the web pages are
represented by vertices and the hyperlinks between them are represented
by edges. Examining web graphs it is possible to discover interesting infor-
mation. For example, extracting dense subgraphs in a web graphs we can
find a community of particular interest. In a graph representation of a web
graph shown in Figure 1.7, two possible communites of particular interests
are indicated by dotted circles.

1.2.6 Bioinformatics

Graph theoretical modelings are used in multiple areas of bioinformatics


including the description of taxonomic trees, phylogenetic analysis, the
genome ontology and proteomics to name a few examples. The graph in
Figure 1.8 illustrates a RNA secondary structure [Sun10].
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

10 Basic Graph Theory

Fig. 1.7 Communities of common interest.

a
a a
g c g
a a
g a
g c
u u
g a a u

Fig. 1.8 RNA secondary structure.

1.2.7 Software Engineering

There are enormous applications of graphs in various areas software engi-


neering such as project planning, data flow analysis, software testing, etc.
A control flow graph used in software testing describes how the control flows
through the program. A control flow graph is a directed graph where each
vertex corresponds to a unique program statement and each directed edge
represents a control transfer from one statement to the other. Analyzing a
control flow graph one can understand the complexity of the program and
can design suitable test suit for software testing.

Exercise

1. Study your campus map and model the road network inside your campus
by a graph.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graphs and Their Applications 11

2. Construct a graph to represent the adjacency relationship of rooms in a


floor of your university building.
3. Consider a party where there are exactly two alernate options of foods
for each category of foods as follows. Rice: plane / yellow, Curry: fish /
chicken, Nan: plain / butter, Kabab: chicken / mutton, Fruit: banana
/ mango, Drink: tea / coffee. Registered participants of the party gave
their options as in Table 1.1. Two participants conflict in their options
if they give different option in the same category. Represent the con-
flicts of the participants using a conflict graph where each participant is
represented by a vertex and there is an edge between two vertices if the
corresponding participants conflict. Observing the conflict graph find
out the minimum number of persons whose absence divides the partici-
pants into two conflict free groups.

Table 1.1 Food Option

Participants Rice Curry Nun Kabab Fruit Drink


Abir plain fish plain chicken mango tea
Bony plain chicken butter mutton banana coffee
Dristy plain fish plain chicken mango tea
Elis plain chicken butter mutton banana coffee
Faria plain fish plain chicken mango tea
Snigdha yellow fish butter chicken mango coffee
Subir yellow chicken butter mutton banana tea
Jony plain fish plain chicken mango tea

4. There are five jobs {J1 , J2 , J3 , J4 , J5 } in a company for which there are
five workers A, B, C, D & E to do those jobs. However, everybody does
not have expertise to do every job. Their expertise is as follows: A =
{J1 , J2 , J3 }, B = {J2 , J4 }, C = {J1 , J3 , J5 }, D = {J3 , J5 }, E = {J1 , J5 }.
Develop a graph model to represent the job expertise of the persons and
find an assignment of jobs to the workers such that every worker can do
a job.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

12 Basic Graph Theory

5. An industry has 400 squre meter area on a floor of a building where it


needs to establish four processing units A, B, C & D. Processing units
A and D requires 100 squre meter area each whereas B and D requires
200 squre meter each. Furthermore the following adjacency requrements
must be satisfied: B, C & D should be adjacent to A; A & D should be
adjacent to B; A & D should be adjacent to C; and A, B & C should
be adjacent to D. Can you construct a floor layout where the space for
each processing unit will be a rectangle? Propose a suitable layout in
your justification.

You might also like