Shortest Path
Everything on SkillVeris tagged Shortest Path — collected across the glossary, study notes, blog, and cheat sheets.
13 resources across 1 library
Interview Questions(13)
BFS vs DFS: What is the Difference?
BFS (breadth-first search) explores a graph level by level using a queue, while DFS (depth-first search) explores as deep as possible along one path before bac…
What is a Graph?
A graph is a data structure made of nodes (vertices) connected by edges, used to model relationships and connections such as networks, maps, or dependencies, a…
What is Dijkstra’s Algorithm?
Dijkstra’s algorithm finds the shortest path from a single source vertex to every other vertex in a weighted graph with non-negative edge weights, using a gree…
What is the Bellman-Ford Algorithm?
Bellman-Ford finds shortest paths from a single source to every other vertex in a weighted graph by relaxing all edges repeatedly for V-1 rounds, and unlike Di…
What is the Floyd-Warshall Algorithm?
Floyd-Warshall is a dynamic programming algorithm that computes the shortest path between every pair of vertices in a weighted graph in O(V^3) time by progress…
What is the A* Search Algorithm?
A* search finds the shortest path between two specific nodes by combining Dijkstra's guaranteed-shortest exploration with a heuristic estimate of remaining dis…
What is Level-Order Tree Traversal?
Level-order traversal visits a binary tree one depth level at a time, left to right, by pushing the root into a FIFO queue and repeatedly dequeuing a node, vis…
Word Ladder Problem: How Would You Solve It?
Word ladder is solved with BFS over an implicit graph where each word is a node and an edge connects two words differing by exactly one letter, because BFS exp…
How Do You Find the Shortest Path in an Unweighted Graph?
The shortest path between two vertices in an unweighted graph is found with breadth-first search (BFS), which explores the graph level by level from the source…
What is the Single-Source Shortest Path Problem?
Single-source shortest path (SSSP) finds the minimum-cost route from one fixed source vertex to every other reachable vertex in a graph, solved with BFS for un…
What is the All-Pairs Shortest Path Problem?
All-pairs shortest path (APSP) computes the minimum-cost route between every pair of vertices in a graph at once, typically solved with the Floyd-Warshall algo…
What is Dynamic Programming on Graphs?
Dynamic programming on graphs solves problems like shortest paths, longest paths, and counting paths by defining a DP state per node (or per node-and-extra-dim…
Weighted vs Unweighted Graphs: What is the Difference?
A weighted graph attaches a numeric cost or value to each edge, such as distance or price, while an unweighted graph only records that a connection exists with…