# Tag Archives: Dijkstra

## 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 »

## Minimum possible modifications in the matrix to reach destination

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 »

## Path with minimum XOR sum of edges in a directed graph

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 »

## Path with smallest product of edges with weight >= 1

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 »

## What are the differences between Bellman Ford’s and Dijkstra’s algorithms?

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 »

## Widest Path Problem | Practical application of Dijkstra’s Algorithm

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 »

## Find the minimum number of moves to reach end of the array

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 »

## Shortest cycle in an undirected unweighted graph

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 »

## Minimum Possible sum of digits in a positive multiple of N

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 »

## Shortest path from source to destination such that edge weights along path are alternatively increasing and decreasing

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 »

## Shortest paths from all vertices to a destination

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 (Dijkstra for large Graphs)

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 »

## Dijkstra’s shortest path algorithm in Java using PriorityQueue

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 »

## Dijkstra’s shortest path with minimum edges

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 »

## Minimum cost path from source node to destination node via an intermediate node

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 »