Graph

Dijkstra’s Shortest Path Algorithm

What is Dijkstra’s Algorithm Dijkstra’s Algorithm is the algorithm to find the shortest path between any two vertices in a graph. Dijkstra’s Algorithm will find the shortest path from a given starting vertex to every other vertices in a graph. Steps Prepare a table to have the shortest distance from a starting vertex and previous vertex. Initialize two list of visited and unvisited nodes Let the distance of a start vertex from the start vertex 0.

Intro to Graphs

What is a Graph? A graph G is an ordered pair of a set V of vertices and a set of E of edges. G can be defines as follows $$G=\left(V,E\right)$$ ordered pair $$(a, b) \neq \left(b,a\right) \text{where} \ a \neq b$$ Graph terminology There are two type of graph, the one is directed graph and the other is undirected graph. Directed graphs contain ordered pairs of vertices while undirected