Prims Algorithm 1.0Related Scripts Categories:
Other Languages 
Software & System 
Tools & Utilities 
Tutorials & Articles 
Web Hosting Tools
In the mathematical field of graph theory, a spanning tree of a connected, undirected graph is a tree which includes every vertex of that graph. More generally, a spanning forest of an arbitrary undirected graph is a forest which includes every vertex of the graph. Spanning forests always exist, and can always be constructed so as to have exactly one tree for each connected component. In certain fields of graph theory, involving weighted graphs, it is often useful to find a minimal spanning tree.Prim's algorithm builds a tree while having the graph connected at all times.Prim's algorithm maintains two lists, EV which is the vertices already in the tree, and E, the list of edges that makes up the spanning tree. In determining current edges for the tree, we look for a node that's in EV, and on that isn't, such that its path is minimum.EV = { 0 }E = { }while( E has < n1 edges ) { find (u,v) with least cost, such thatu is in EV and v isn't in EV if no such edge exists, break add v to EV add (u,v) to E}On termination, if the graph is connected, EV will contain all the nodes in the graph, and E will contain the set edges comprising the minimum spanning tree. Tags: Lists, Maintains, Vertices, Edges, Times, Prim, Minimal, Algorithm Platforms: BSD , Mac OS X , Solaris , linux
More Similar Scripts
Similar Software

Scripts Categories
Related Scripts
Encryption Algorithm Simulation Script 1
LZW Compression Algorithm 1.1
Grey prediction algorithm for mobile user localization 1.0
NSGA  II: A multiobjective optimization algorithm 1.0
Gravitational Search Algorithm (GSA) 1.0
LAPJV  JonkerVolgenant Algorithm for Linear Assignment Problem V2.4 1.0
Particle Swarm Optimization (PSO) algorithm 1.0
Heuristic Algorithm for finding Maximum Independent Set 1.0
Model Determination using Genetic Algorithm: ForstKalkwarfThodos Model 1.0
Hungarian Algorithm for Linear Assignment Problems (V2.2) 1.0 Popular Scripts
