Search⌘ K
AI Features

Challenge: Find the Shortest Path between Two Vertices

Explore how to determine the shortest path between two nodes in a directed graph by counting edges. This lesson helps you understand graph traversal and algorithm implementation using Python to handle pathfinding challenges.

We'll cover the following...

Statement

Given a directed graph of n nodes and two vertices, src and dest, return the length of the shortest path between src and dest. The shortest path will contain the minimum number of edges.

If no path exists between src and dest, return -1.

Constraints:

...