0% found this document useful (0 votes)
926 views7 pages

Prims Algorithm

Prim's algorithm finds a minimum spanning tree of a connected, undirected graph. It continuously increases the size of a tree starting with a single vertex until it spans all vertices. The algorithm was discovered in 1930 but independently rediscovered by Robert Prim in 1957. It works by maintaining a closed list of nodes and edges that connect them into the minimum spanning tree.

Uploaded by

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

Prims Algorithm

Prim's algorithm finds a minimum spanning tree of a connected, undirected graph. It continuously increases the size of a tree starting with a single vertex until it spans all vertices. The algorithm was discovered in 1930 but independently rediscovered by Robert Prim in 1957. It works by maintaining a closed list of nodes and edges that connect them into the minimum spanning tree.

Uploaded by

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

Prim's Algorithm

on minimum spanning tree

Submitted by:
Darshnik Deep (38150)
Harshal Paliwal ( )
Department of Computer Science,
Suresh Gyan Vihar University
Jagatpura, Mahal sadak yojna.
Project on Prims Algorithm
• Index
• What is minimum spanning
tree.
• Graph
• Algorithm
• About
What is Minimum Spanning Tree?
• Given a connected, undirected graph, a
spanning tree of that graph is a subgraph
which is a tree and connects all the
vertices together.
• A single graph can have many different
spanning trees.
• A minimum spanning tree is then
a spanning tree with weight less
than or equal to the weight of
every other spanning tree.
graph G

Spanning Tree from Graph G


2 2

4 3 4 5

1 1 1
Algorithm for finding
Minimum Spanning Tree

• The Prim's Algorithm


About Prim’s Algorithm
The algorithm was discovered in 1930 by
mathematician Vojtech Jarnik and later
independently by computer scientist Robert C. Prim
in 1957.
The algorithm continuously increases the size of a
tree starting with a single vertex until it spans all the
vertices.
Prim's algorithm is faster on dense
graphs.
Prim's algorithm runs in O(n*n)
But the running time can be reduce
using a simple binary heap data structure
and an adjacency list representation
• Prim's algorithm for finding a minimal
spanning tree parallels closely the depth-
and breadth-first traversal algorithms. Just
as these algorithms maintained a closed
list of nodes and the paths leading to
them, Prim's algorithm maintains a closed
list of nodes and the edges that link them
into the minimal spanning tree.
• Whereas the depth-first algorithm used a
stack as its data structure to maintain the
list of open nodes and the breadth-first
traversal used a queue, Prim's uses a
priority queue.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy