Eroxl's Notes
Weighted Edge

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:

  • In an undirected graph, a weighted edge is written as where is the weight.
  • In a directed graph, a weighted edge is written as where is the origin, is the destination, and is the weight.