## Shortest path in a directed graph by Dijkstra’s algorithm

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 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:… 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… 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… 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 »

Given a number N, find the minimum possible sum of digits that can be obtained from a positive Multiple of N. Constraints : 1<=N<=10^5. Examples:… Read More »

Given a connected graph with N vertices and M edges. The task is to find the shortest path from source to the destination vertex such… Read More »

Given a Weighted Directed Graph and a destination vertex in the graph, find the shortest distance from all vertex to the destination vertex. Input :… Read More »

Uniform-Cost Search is a variant of Dijikstra’s algorithm. Here, instead of inserting all vertices into a priority queue, we insert only source, then one by… Read More »

Given a graph with adjacency list representation of the edges between the nodes, the task is to implement Dijkstra’s Algorithm for single source shortest path… Read More »

Prerequisite: Dijkstra’s shortest path algorithm Given an adjacency matrix graph representing paths between the nodes in the given graph. The task is to find the… Read More »

Given an undirected weighted graph. The task is to find the minimum cost of the path from source node to the destination node via an… Read More »