# Tag Archives: Shortest Path

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. Attention reader! Don’t stop… 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 Shortest… 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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and… Read More
There are N stations on route of a train. The train goes from station 0 to N-1. The ticket cost for all pair of stations… Read More
Given a snake and ladder board, find the minimum number of dice throws required to reach the destination or last cell from source or 1st… Read More
Given a directed and two vertices ‘u’ and ‘v’ in it, find shortest path from ‘u’ to ‘v’ with exactly k edges on the path.The… Read More
Question 1: Given a directed weighted graph. You are also given the shortest path from a source vertex ‘s’ to a destination vertex ‘t’.  If… Read More
The problem is to find shortest paths between every pair of vertices in a given weighted directed Graph and weights may be negative. We have… Read More
Given a Weighted Directed Acyclic Graph (DAG) and a source vertex s in it, find the longest distances from s to all other vertices… Read More
Given a Weighted Directed Acyclic Graph and a source vertex in the graph, find the shortest paths from given source to all other vertices.  Recommended:… Read More
Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may… Read More
We recommend reading the following two posts as a prerequisite of this post.1. Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm) 2. Graph and its representationsWe… Read More