A weighted edge is a type of edge that has an associated numerical value, called its weight. This weight typically represents a cost, distance, time, capacity, or any other quantitative measure relevant to the graph application. Formally, a weighted edge is defined as a pair together with a weight: