Concept Flow - Why Shortest Path Is a Graph Problem Not a Tree Problem
Start: Need shortest path
Is data a Tree?
Yes→Unique path exists
Shortest path = unique path
Is data a Graph?
Yes→Multiple paths possible
Need algorithms to find shortest path
No path problem
We check if the data is a tree or graph. Trees have unique paths, so shortest path is trivial. Graphs can have many paths, so shortest path needs special algorithms.
