weighted graph

A graph in which every edge carries a number, its weight, such as a distance, cost or travel time.

In more detail

In an adjacency list, weighted edges are stored as (neighbour, weight) tuples; in a matrix, each cell holds the weight instead of a 1. Shortest paths and minimum spanning trees are measured in total weight rather than number of edges.

Related terms

Taught in

References