Skip to content

Tag Archives: Dijkstra

Barbara got really good grades in school last year, so her parents decided to gift her with a pet rabbit. She was so excited that… Read More
Dijkstra’s Algorithm: It is a graph searching algorithm that uses a Greedy Approach to find the shortest path from the source node to all other… Read More
Given a directed and weighted graph of N nodes and M edges, the task is to count the number of shortest length paths between node… Read More
Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning trees. Like Prim’s MST, we generate a SPT (shortest path tree) with a given… Read More
Dijkstra’s algorithm is one of the most popular algorithms for solving many single-source shortest path problems having non-negative edge weight in the graphs i.e., it… Read More
Given a graph of N Nodes and E edges in form of {U, V, W} such that there exists an edge between U and V… Read More
Given an undirected graph of N nodes and M edges of the form {X, Y, Z} such that there is an edge between X and… Read More
Given a directed graph and a source vertex in the graph, the task is to find the shortest distance and path from source to target… Read More
Given a matrix of size N x M consisting of integers 1, 2, 3 and 4. Each value represents the possible movement from that cell:  1… Read More
Given a directed graph with N nodes and E edges, a source S and a destination D nodes. The task is to find the path… Read More
Given a directed graph with N nodes and E edges where the weight of each of the edge is > 1, also given a source… Read More
Bellman Ford’s algorithm Like other Dynamic Programming Problems, the algorithm calculates shortest paths in a bottom-up manner. It first calculates the shortest distances which have at-most… Read More
It is highly recommended to read Dijkstra’s algorithm using the Priority Queue first.Widest Path Problem is a problem of finding a path between two vertices… Read More
Given an array arr[] of size N where every element is from the range [0, 9]. The task is to reach the last index of… Read More
Given an undirected unweighted graph. The task is to find the length of the shortest cycle in the given graph. If no cycle exists print… Read More