A weighted graph attaches a number to every edge, standing for cost, distance, time, or capacity. An unweighted graph treats all edges as equal, so a hop is just a hop. Adding weights changes the question from "how few edges" to "how little total cost".
That shift matters because the cheapest route is often not the shortest by edge count. Three short highway segments can beat one long back road. On a map, weights are miles or minutes; on a network, they might be latency or price.
The consequence for algorithms is real. Plain breadth-first search finds fewest-edge paths, but it ignores weights and gives wrong answers once they exist. You then need weight-aware methods like Dijkstra. So the first thing to ask about any graph problem is whether edges carry meaningful cost, because that single fact decides which algorithm is even correct.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓