We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Weighted Graphs

Graphs can be of many types: weighted or unweighted, directed or undirected, etc. Dijkstra's algorithm specifically deals with weighted graphs.

A weighted graph has edges with "weight" or "cost." The weight of an edge can represent distance, time, or anything related to the "cost of traversing" the nodes that it connects.