Skip to content

Tag Archives: Dijkstra

Given a directed weighted graph represented by a 2-D array graph[][] of size n and 3 integers src, dst, and k representing the source point,… Read More
Given an adjacency matrix graph[][] of a weighted graph consisting of N nodes and positive weights, the task for each connected component of the graph… Read More
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

Start Your Coding Journey Now!