Example 14.3.1. A road map weighted by distances.
A road map with distances as weights is a weighted graph. Below is a simplified road map of the area around Camrose, Alberta. The vertex set is the set of cities, and the edge set is the set of highways. For example, the two-city set {Camrose, Edmonton} represents the edge on the graph between Camrose and Edmonton, and corresponds to Highway 21.
{Camrose, Edmonton} | |
{Edmonton, Leduc} | |
{Leduc, Wetaskiwin} | |
{Wetaskiwin, Camrose} |
The edges in the graph are weighted by the (rounded) highway distances between cities. Formally, this is a function from the edge set to the natural numbers. The input-output relationship defining this function is tabulated above right.