This is a Graph Theory based project to connect all the villages in an area, most efficiently. It uses the Prim's algorithm to construct the Minimum Spanning Tree for the graph.
Create a new Graph object. By using the addNode(..)
, and the addEdge(..)
functions, construct a graph.
The graph object contains variables that store all the edges, the nodes, and the number of nodes in the particular graph.
By default, the addEdge(..)
function adds a bidirectional edge between the two target nodes.
Another function, addSingularEdge(..)
adds a directed edge between the two targeted nodes.
The Graph class also has functions to create, and populate an adjacency matrix, calculate the number of components in the graph, update and modify edges, and to check if an edge exists.
The bootstrap template used for this project was not created by us. We do not claim credit for it, in anyway.