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

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 »

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

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

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 »

Given a Weighted Directed Acyclic Graph (DAG) and a source vertex in it, find the longest distances from source vertex to all other vertices in… Read More »

Given a matrix that is filled with ‘O’, ‘G’, and ‘W’ where ‘O’ represents open space, ‘G’ represents guards and ‘W’ represents walls in a… Read More »

Given a path in the form of a rectangular matrix having few landmines arbitrarily placed (marked as 0), calculate length of the shortest safe route… Read More »

Given a screen containing alphabets from A-Z, we can go from one character to another characters using a remote. The remote contains left, right, top… Read More »

Given a MxN matrix where each element can either be 0 or 1. We need to find the shortest path between a given source cell… Read More »

Dijkstra’s shortest path algorithm runs in O(Elog V) time when implemented with adjacency list representation (See C implementation and STL based C++ implementations for details).… Read More »

Given a graph and a source vertex in graph, find shortest paths from source to all vertices in the given graph. Input : Source =… Read More »

Given a graph and a source vertex in graph, find shortest paths from source to all vertices in the given graph. We have discussed Dijkstra’s… Read More »

Given a directed graph where every edge has weight as either 1 or 2, find the shortest path from a given source vertex ‘s’ to… Read More »

filter_none edit close play_arrow link brightness_4 code import java.util.Scanner; //Scanner Function to take in the Input Values public class Dijkstra { static Scanner scan;… Read More »