Path Finding (cont)
The above algorithm finds a "shortest" path
- based on minimum # edges between src and dest.
- stops with first-found path, if there are multiple ones
- we visit nodes in order of their distance from src
In many applications, edges are weighted and we want
- based on minimum sum-of-weights along path src .. dest
We discuss weighted/directed graphs later.
|