Prim's Algorithm in Creating a MST program visually shows the target MST (Minimum Spanning Tree) with all steps of reaching to it, finally tells the log of selected graph edges and Adjacency matrix of the main tree.
-
There are two options in the program, one is getting the Adjacency matrix from user, another one is creating a random graph (Actually the Adjacency matrix) with a user choice as the number of nodes in the graph from user.
-
the random option is based on a preference and could be changed to another settings. Right now it creates a graph with (a little bit bigger than) 1/3 chance of not having an edge between two selected nodes. And about 2/3 chance for nodes to have an edge between with the weight range of 1 to 40.