A weighted graph is a graph in which each edge carries a numeric weight representing cost, distance, capacity or another quantity relevant to the traversal or connection it models. Weights generalise simple adjacency into a richer structure that supports shortest-path, minimum-spanning-tree and flow algorithms. Search algorithms such as A* use edge weights together with a heuristic to find least-cost paths efficiently.

Provenance