## Finding the path from one vertex to rest using BFS

Given an adjacency list representation of a directed graph, the task is to find the path from source to every other node in the graph… Read More »

## Minimum Numbers of cells that are connected with the smallest path between 3 given cells

Given coordinates of 3 cells (X1, Y1), (X2, Y2) and (X3, Y3) of a matrix. The task is to find the minimum path which connects… 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 »

## Multi Source Shortest Path in Unweighted Graph

Suppose there are n towns connected by m bidirectional roads. There are s towns among them with a police station. We want to find out… Read More »

## Number of shortest paths in an unweighted and directed graph

Given an unweighted directed graph, can be cyclic or acyclic. Print the number of shortest paths from a given vertex to each of the vertices.… Read More »

## Probabilistic shortest path routing algorithm for optical networks

Data transfer operations is a crucial aspect in case of networking and routing. So efficient data transfer operations is a must need, with minimum hardware… Read More »

## Shortest path to reach one prime to other by changing single digit at a time

Given two four digit prime numbers, suppose 1033 and 8179, we need to find the shortest path from 1033 to 8179 by altering only single… Read More »

## Comparison of Dijkstra’s and Floyd–Warshall algorithms

Main Purposes: Dijkstra’s Algorithm is one example of a single-source shortest or SSSP algorithm, i.e., given a source vertex it finds shortest path from source… Read More »

## Shortest distance between two cells in a matrix or grid

Given a matrix of N*M order. Find the shortest distance from a source cell to a destination cell, traversing through limited cells only. Also you… Read More »

## Karp’s minimum mean (or average) weight cycle algorithm

Given a directed and strongly connected graph with non negative edge weighs. We define mean weight of a cycle as the summation of all the… Read More »

## 0-1 BFS (Shortest Path in a Binary Weight Graph)

Given a graph where every edge has weight as either 0 or 1. A source vertex is also given in the graph. Find the shortest… Read More »

## Find minimum weight cycle in an undirected graph

Given positive weighted undirected graph, find minimum weight cycle in it. Examples: Minimum weighted cycle is : Minimum weighed cycle : 7 + 1 +… Read More »

## Find the minimum number of moves needed to move from one cell of matrix to another

Given a N X N matrix (M) filled with 1 , 0 , 2 , 3 . Find the minimum numbers of moves needed to… Read More »

## Minimum Cost Path with Left, Right, Bottom and Up moves allowed

Given a two dimensional grid, each cell of which contains integer cost which represents a cost to traverse through that cell, we need to find… Read More »