0% found this document useful (0 votes)
46 views24 pages

A Study On Application of Graph Theory in Operation Research

Uploaded by

Shikha Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views24 pages

A Study On Application of Graph Theory in Operation Research

Uploaded by

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

A STUDY ON APPLICATION OF SPANNING TREE IN

OPTIMIZATION OF THE LENGTH OF WATER PIPELINE

PROJECT REPORT
Submitted in partial fulfillment of the Requirement

for the degree of

B.Sc. (HONOURS)
In
Mathematics

PROJECT GUIDE: SUBMITTED BY:


Dr. Alok Kumar Gahlot Jatin Kumar Gangwar (TEN2129013)

Assistant Professor Ishika Yadav (TEN2129011)

Department of Mathematics Akanksha Sharma (TEN2129003)

Deepashikha Yadav (TEN2129025)

MAY, 2024

DEPARTMENT OF MATHEMATICS (FOE) TEERTHANKER


MAHAVEER UNIVERSITY, MORADABAD
DECALARATION

We , Jatin Kumar Gangwar (TEN2129013) , Ishika Yadav (TEN2129011), Akanksha Sharma


(TEN2129003) & Deepashikha Yadav (TEN2129025) are students of B.sc. (H) Mathematics,
6th Semester, studying at Faculty Of Engineering, Teerthanker Mahaveer University,
Moradabad (UP), hereby declare that the Training Report on “ A Study on Application of
Minimum Spanning Tree in Optimization of the length of Water Pipeline” submitted in
partial fulfillment of Bachelor of Science(Mathematics) , is the original work conducted by
us. The information and data given in this report is authentic to the best of our knowledge.

This Project Report is not submitted to any other University for award of any Degree,
Diploma and Fellowship.

Date: Jatin Kumar Gangwar (TEN2129013)

Ishika Yadav (TEN2129011)

Akanksha Sharma (TEN2129003)

Deepashikha Yadav (TEN2129025)


CERTIFICATE

This is to certify that Project entitled “A Study on Application of Minimum Spanning Tree in
Optimization of Length of Water Pipeline” has been submitted in partial fulfillment of the
requirement for the degree of B.Sc. (H) MATHEMATICS is carried out by students, names
listed below under my supervision and guidance.

Students Name:

Jatin Kumar Gangwar (TEN2129013)

Ishika Yadav (TEN2129011)

Akanksha Sharma (TEN2129003)

Deepashikha Yadav (TEN2129025)

Project Guide: Signature:

Dr. Alok Kumar Gahlot

Assistant Professor

Department of Mathematics

Date:
ACKNOWLEDGEMENT

We are happy to greatly acknowledge the numerous personalities involved in lending their
help to make our project “A Study on Application of Minimum Spanning Tree in
Optimization of the length of the Water Pipeline.” a successful one.

We take this opportunity to express our deep sense of gratitude to our honorable Principal
“Prof. R.K. DWIVEDI” for providing excellent academic climate in the college that made this
endeavor possible.

We give our whole hearted admiration and deep sense gratitude to “DR. AJIT CHAUHAN
”,HOD,” DEPARTMENT OF MATHEMATICS”, TMU for his inspiration, valuable guidance,
encouragement, suggestion and overall help throughout.

We express our sincere thanks to our guide DR. ALOK KUMAR GAHLOT,” ASSISTANT
PROFESSOR “DEPARTMENT OF MATHEMATICS “, TMU, for his keen interest and invaluable
help throughout the project.

Finally, we express our gratitude to all the Teaching and Non-teaching staff of
“DEPARTMENT OF MATHEMATICS”, TMU for their timely support and suggestion.

Date:
ABSTRACT

The system of urban water supply network is the important lifeline project of the city. With
the continuous development of social economy, people are no longer satisfied with water
supply requirements. People put forward higher requirements for the safety, reliability and
economy of the water supply. Based on actual demands to solve the economic problems of
water supply network we need to ensure the lowest costs in laying the pipelines. First we
need to establish a mathematical model of water supply network, so that we can use the
knowledge of graph theory to solve this problem. The minimum spanning tree was used to
ensure that costs are the lowest in the case of pipeline connectivity. Then using the
Kruskal’s algorithm to generate minimum spanning tree, finally an example was analyzed to
verify its practicality, and the algorithm solved the problem of water supply network in
laying pipelines successfully.

Key Words: Kruskal’ Algorithm, Minimum Spanning Tree, Urban Water supply network
TABLE OF CONTENTS

1) Project Introduction……………………………………………………………………………….07

2) Basic Definitions…………………………………………………………………………………….08

 2.1 Graph…………………………………………………………………………………………...................08
 2.2 Edge……………………………………………………………………………………………………………..08
 2.3 Vertex…………………………………………………………………………………………………………..08
 2.4 Tree………………………………………………………………………………………….…………………..08
 2.5 Spanning………………………………………………………………………………….......................08
 2.6 Minimum Spanning Tree……………………………………………………….………………………08

3) Properties of Minimum Spanning Tree…………………………………………………09

4) Applications of Spanning Tree………………………………………………………………10

5) Algorithms for obtaining the minimum spanning tree……….………………11

 5.1 Kruskal’s Algorithm………………………………………………………..……….………………….11


 5.2 Prim’s Algorithm……………………………………………………………………………..........11

6) Difference between Prim’s & Kruskal’s algorithm………………………………12

7) Statement of Problem………………………………………………………………………………….13

 7.1 Problem Statement……………………………………………………………………………………13


 7.2 Problem Solution……………………………………………………………………………………14-21
 7.3Result…………………………………………………………………………………………………………22

8) Conclusion…………………………………………………………………………………………23

9) References………………………………………………………………………………………24
CHAPTER-1

INTRODUCTION

A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges
of a connected, edge-weighted undirected graph that connects all the vertices together,
without any cycles and with the minimum possible total edge weight. That is, it is a spanning
tree whose sum of edge weights is as small as possible. More generally, any edge-weighted
undirected graph (not necessarily connected) has a minimum spanning forest, which is a
union of the minimum spanning trees for its connected components.

There are many use cases for minimum spanning tree. One example is of laying water
pipelines in an area. If it is constrained to lay the water pipeline in an area, then there would
be graph containing the points (e.g. Water tanks) connected in that area. Some of the paths
to the water tank might be more expensive, because they are far, these paths would be
represented by edges with larger weights.

A spanning tree for that graph would be a subset to those paths that have no cycles but still
connects every area; there might be several spanning tree possible. A minimum spanning
tree would be the one with the lowest total cost, representing the least expensive path for
laying the water pipeline.

Minimum spanning trees have direct applications in the design of network, including
computer networks, telecommunication networks, water-supply networks, and electrical
grids. They are invoked as subroutines in algorithms for other problems, including the
Christofides algorithm for approximating the multi-terminal minimum cut problem (which is
equivalent in the single-terminal case to the maximum flow problem), and approximating
the minimum-cost weighted perfect matching.
CHAPTER-2

BASIC DEFINITIONS

2.1 Graph: A graph G is made up of a set V of nodes (vertices) and a set E of arcs (edges). G
is expressed as (V,E), where V is a finite set of vertices that is not empty. The collection of
pairings of vertices in E is referred to as edges.

2.2 Edge: A line that joins two vertices is known mathematically as an edge. A single vertex
can give rise to several edges. An edge cannot be generated without a vertex. An edge
needs a beginning vertex and an ending vertex.

2.3 Vertex: A vertex is a place where several lines converge. Another name for it is a node.

2.4 Tree: A linked acyclic (i.e., devoid of cycles) graph is a tree.

2.5 Spanning: Spanning represents sub graph that contains all the nodes but only enough of
the edges to form a tree.

2.6 Minimum Spanning Tree: The minimum spanning tree (MST) of a graph defines the
cheapest subset of edges that keeps the graph in one connected component. And a
spanning tree will be formed by any connected graph by eliminating the edges that leads to
cycles, it is simple to create a spanning tree for a graph.
CHAPTER-3

PROPERTIES OF MINIMUM SPANNING TREE

The properties of a minimum spanning tree are:

 Possible Multiplicity: If there are n vertices in the graph, then the spanning tree has
(n-1) edges.
 Uniqueness: If each edge has a distinct weight, then there will be only one, unique
minimum-spanning tree.
 Minimum-Cost sub graph: If the weights are positive, then a minimum spanning
trees is in fact a minimum-cost sub graph connecting all vertices.
 Cycle property: For any cycle C in the graph, if the weight of an edge e of C is larger
than the individual weights of all other edges of C, then this edge cannot belong to
MST.
 Cut Property: For any cycle C of the graph, if the weight of an edge e in the cut-set of
C is strictly smaller than the weights of all other edges of the cut-set of C, then this
edge belongs to all minimum spanning tree of the graph.
 Minimum-Cost Edge: If the minimum cost edge e of a graph is unique, then this edge
is included in any minimum spanning tree.
 Contraction: If T is a tree of MST edge, then we can contract T into a single vertex
while maintaining the invariant that the MST of the contracted graph plus T gives the
minimum spanning tree for the graph before contraction.

CHAPTER-4
APPLICATIONS OF SPANNING TREE

1. The design of physical systems, such as, computer chips, communication systems,
constructing highways, railroads spanning several cities, laying pipelines connecting offshore
drilling sites, refineries and consumer markets.

2. Network Designs of Telephone, Electricals, Cables, Roads, Airlines, Hydraulic systems, TV


cables, Approximation algorithms for NP-hard problems, Travelling Salesperson Problem,
Steiner tree, and in designing local access network.

3. Indirect applications such as max bottleneck paths, Error correction and Data
compression.

4. Model locality of particle interactions in turbulent fluid flows, auto configured protocol
for Ethernet bridging to avoid cycles in a net.

5. In an airline map where edges represent flight routes, these weights might represent
distances or fares.

6. In an electric circuit where edges represent wires, the weights might represent the length
of the wires, its cost, or the time that it takes a signal to propagate through it. It helps in
making electric wire connections on a control panel.

7. Topological observables in power systems.

8. Measuring homogeneity of two-dimensional materials.

9. Minimax process control.

10. Minimum spanning trees can also be used to describe financial markets.

CHAPTER-5
ALGORITHMS FOR OBTAINING THE MINIMUM SPANNING TREE

5.1 Kruskal’s Algorithm:

This algorithm creates a forest of trees. Initially the forest consists of n single node trees
(and no edges). At each step, we add one edge (the cheapest one) so that it joins two trees
together. If it were to form a cycle, it would simply link two nodes that were already part of
a single connected tree, so that this edge would not be needed.

 Algorithm Steps:
1. Sort the graph edges with respect to their weights.
2. Start adding edges to the minimum spanning tree from the edge with the smallest
weight until the edge of the largest weight.
3. Only add edges which does not form cycle, edges which connect only disconnected
components.

5.2 Prim’s Algorithm:

This algorithm starts with one node. It then, one by one, adds a node that is unconnected to
the new graph to the new graph, each time selecting the node whose connecting edge has
the smallest weight out of the available nodes connecting edges.

 Algorithm Steps:
1. Maintain two disjoint sets of vertices. One containing vertex that are in the growing
spanning tree and other that are not in the growing spanning tree.
2. Select the cheapest vertex that is connected to the growing spanning tree and is not
in the growing spanning tree and add it into the growing spanning tree. This can be
done using Priority Queues. Insert the vertices that are connected to growing
spanning tree, into the Priority Queue.
3. Check for cycles. To do that, mark the nodes which have already been selected and
insert only those nodes in the Priority Queue that are not marked.

CHAPTER-6

DIFFERENCE BETWEEM PRIM’S & KRUSKAL’S ALGORITHM


S.No. Prim’s Algorithm Kruskal’s Algorithm

1. Prim's algorithm always chooses the next edge The Kruskal’s algorithm always chooses the
which is a neighbour of vertices in partially edge having a minimum weight.
generated solution.

2. Selection of the route is based on vertices Selection of the route is based on edges

3. Prim's algorithm ensures that a partial solution is In Kruskal's algorithm, a partial solution
always a tree. can be a forest.

4. Sorting of edges is not required. Sorting of edges is compulsory.

5. Solution is initiated with a node. Solution is initiated with an edge.

6. Picking up next edge requires finding an edge As edges are always sorted, minimum cost
with minimum cost from a set of adjacent edges. edge can be chosen in O (1) time.

7. Prism’s algorithm is a better choice for the dense Kruskal’s algorithm is a better choice for
graph. the sparse graph.

CHAPTER-7

STATEMENT OF PROBLEM

7.1) Problem Statement:


There are many buildings / landing points (such as education institutions, Residental
buildings, Hospital etc) in Rajendra Nagar and Lalit Puri,Meerganj Area ,District-Bareilly U.P.
Water Supply is essential for area of concern therefore our main objective is to optimize the
length of water pipeline of the existing water supply network in our area of study. We will
try to optimize the total length of network.

To achieve this objective mentioned above we will use the application of minimal spanning
tree.

1) Kruskal’s Algorithm

2) Prim’s Algorithm

Since, both the methods have different kinds of provocation completely based on the size of
data to be analyzed. The main provocation is to use a method which includes simplicity and
possibilities to avoid error. This analysis is completely based on Kruskal Algorithm.

The Kruskal method is easier than Prim’s algorithm when data get collected on small locality
in pen paper reading. And the prim’s is suitable for the large locality and to work with
software. I am very sure that a few of you are working for cable networking companies. So,
let's relate the difficulty of the Kruskal's minimum spanning tree algorithm to more everyday
situations.

7.2) Problem Solution:

Here is the map of my locality (Rajendra Nagar & Lalitpuri) which we got through the Jal
Nagar Nigam Aayog located in my locality. This helped us to take the destination for making
Minimum spanning tree. The total distance of the area is 5.75 km.
Fig1. Map of our locality

Courtesy: Jal Nagar Nigam

Let's streamline the map by turning it into a graph as shown below and giving key spots on it
letters along with their distances in meters.

Government Sant Mangalpuri Tehsil Parisar Malipura Eidgah


Hospital Inter College
A B C D E

Lalit Puri Divya Kripal Brahma Devi Sirouli Chauraha Government


Inter College Inter College Block

F G H I J

Bazaar Pashu Aahar Bijli Ghar Rajendra Prasad Teacher Colony


Kendra Inter College

K L M N O

By this representation, we get a graphical representation of the general map of our locality
in which we want to spread water pipeline. Let's examine the real-world application of
Kruskal's technique using the above map since we must reduce both the length and the
cost.
Fig.2. Graphical Representation of Map of our Locality

Step 1- Take away all loop and parallel edges.

Step 2- Arrange the graph’s edges in ascending order. Each group is treated as a tree in
Kruskal’s technique, which uses disjoint sets to determine how many of the vertices are
connected to their trees.
Level (Vertex) Distance (In Meters )

H,I 0.08

B,C 0.09

C,G 0.11

L,M 0.16

J,L 0.17

M,N 0.19

K,J 0.20

J,O 0.25

L,O 0.25

C,E 0.30

G,F 0.30

I,K 0.30

E,F 0.40

A,B 0.45

B,D 0.45

G,H 0.45

A,C 0.50

E,D 0.50

G,K 0.60

Table.2. Arrangement of Length of Cable in Ascending Order


Step 3- We start by adding the edges that have the lowest weight and cost. Hence H-I is
connected first taking into account simply their edge length 0.08.And then connect B-C, C-G,
L-M too having length 0.09, 0.11 and 0.16 respectively.

Fig.3

Step 4- Now connect J,L, M,N, K,J, J,O, C,E, G,F having the edges length
0.17,0.19,0.20,0.25,0.30 &0.30 respectively.
Fig.4

Step 5- Now connect I,K, A,B, and B,D having length 0.30,0.45 & 0.45 respectively .
Fig.5

Step 6: Now connect (G,H) having the edge length 0.45.


There are no loops or cycles generated between any two vertices thanks to the ascending
sequence in which all the edges are joined as seen in the table above. The resulting graph is
the lowest spanning tree for the given problem, and it is shown below.

Fig.6

7.3 Result:
The total length of pipeline used in the process is given by:

(0.08+0.09+0.11+0.16+0.17+0.19+0.20+0.25+0.30+0.30+0.30+0.45+0.45+0.45= 3.50 km)

The existing distance of the total area was 5.75 km.

Here we are successfully able to optimize the pipe water supply network by Kruskal’s
Algorithm.

CHAPTER-8
CONCLUSION

In this project we have deeply and immensely studied about the optimization in length of
water pipeline spread through our locality. And in order to lower the barrier, we use the
idea of minimal spanning tree to lower the price of water pipeline. Here, we have used an
algorithm (e.g., Kruskal’s algorithm) that can be easily implemented for the given area. A
major advantage of this algorithm is that it deports the need of sorting the edges of the
given graph. In addition of removing one of the edges from a selected cycle also breaks so
many cycles making it faster. Because a spanning tree lacks loops and cycles and cannot be
disconnected, it cannot be disconnected. These sentences lead us to the conclusion that
every linked graph G has at least one spanning tree.

A method to find a minimum spanning tree from a given graph that has all of the graph’s
vertices and v-1 edges with the least amount of cost is Kruskal’s algorithm. In this project
we have to go for so many obstacles (i.e. …., location related problems etc.). For which we
used the map that we got through the Jal Nagar Nigam located in my locality. Maps are able
to demonstrate basic spatial relationships and highlighted features and they are also helpful
in providing the information that cannot be obtained or observed directly and we got the
locations of the points in a visual way. It also helped us too se the distribution of a particular
area in a defined location. It also helped us in determining the distance between the points
that we considered weights. With the help of map we were able to find the structure and
value content in our locality very easily. This effort is all a part of a larger and more
important cross cutting requirement for the area to widen and deepen usage of spatial
approach so that we were better able to understand the linkages inside and among the
numerous challenges and opportunities, and we were able to do it. It has always been our
work to create maps.

CHAPTER-9
REFERENCES

(1) Douglas B West,” Introduction to Graph Theory”,(Prentice Hall,1996).

(2) F.HARARY,”Graph Theory”,(Addison-Wesley,1968).

(3) A Comparative Study of Minimal Spanning Tree Algorithms (March, 2020).


https://doi.org/10.1109/ICMCECS47690.2020.240900

(4)R.J. WILSON,” Introduction to Graph Theory”, Longman,(3. rd ed.) 1985

(5) S.EVEN,”Graph Algorithms”,(Computer Science Press,1979).

(6) R. DIESTEL,” Graph Theory”, (Springer-Verlag, 1997).

(7) Jump up to: a b c d e Pettie, Seth; Ramachandran, Vijaya (2002),”An optimal minimum
spanning tree algorithm”(PDF), journal of the association for computing machinery, 49
(1):16-34,doi:10.1145/505241.505243, MR 218431, S2CID 5362916.

(8) An efficient Greedy Minimum Spanning Tree Algorithm Based on Vertex Associative Cycle
Detection Method (2016).doi:https://dx.doi.org/10.1016/j.procs.2016.07.376.

(9) Fujie, F., & Zhang, P.(2014). Covering walks in graphs. Springer Briefs in
Mathematics.doi:10.1007/978-1-4939-0305-4.

(10) Jump up to: a b Chazelle, Bernard (2000),”A minimum Spanning Tree algorithm with-
inverse-Ackerman type complexity”, Journal of the association for computing
machinery,47(6):1028- 1047,doi:10.1145/355541.355562, MR 1866456, S2CID 6276962.

You might also like