Abstract

Shortest path algorithm. Graphs are an example of non-linear data structure. A graph is a collection of nodes which are connected by edges. The definition of graph G = (V, E) is basically a collection of vertices and edges. Graphs can be classified on the basis of types of edges. Directed graphs have each of the edges directed which means the edges connecting the two nodes defines the way it is connected from and to. On the other side, undirected graphs have edges which have no direction. The edges of a graph have weights which are associated with it. The weight of an edge can be thought as the cost of the edge. Let’s assume there are two vertices representing two cities, then the weight of the edge between the vertices may represent the distance between the cities. Given a given graph and a particular node, we can find a path of least total weight from that node to other vertices of the graph. The total weight of the path will be the sum of the weights of the edges. Graphs can be used in real life to find the shortest path between two destinations, used in social networking sites like facebook and the world wide web where the web pages are represented by the nodes. Dijkstra’s Algorithm, Floyd – Warshall, Bellman Ford Algorithm, Johnson’s algorithm, A* search algorithm are some of the shortest path algorithms.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call