Search⌘ K
AI Features

Challenge 8: Find the Shortest Path Between Two Vertices

Explore how to implement a function in C# that finds the shortest path between two vertices in a directed graph. Understand how to determine the minimum number of edges between source and destination or detect invalid nodes. This lesson guides you through designing an algorithm before coding for efficient graph traversal.

Problem statement

Implement the int findMin(Graph g, int source, int destination) function, which will take a graph and two vertices: source and destination. The result will be the shortest path from source to ...