Dijkstra’s Algorithm

We have seen Prim’s Algorithm for Minimum Spanning Tree. Dijkstra’s Algorithm, also known as Single source Shortest Path, is similar to it but we use it for graphs. When we are provided with a graph and a source vertex, this method is used to find the minimum distance of that particular vertex from the source […]

Prim’s Algorithm

Prim’s algorithm is used to find the minimum spanning tree from a graph. It finds the subset of edges that includes every vertex such that the total of the weights of edges should be minimum. How this is done? Will go through the step-by-step procedure! Algorithm: Step 1: From the given graph, remove all loops […]

Greedy method

“Do you want to buy a car?” If this is the situation, how would you choose a car? Assume that you need a car with better features. Will you go on testing or checking all the car models in the world and then buy it? My answer would be no. I shall separate out or […]