weighted graph
a weighted graph is
such that
is a graph (directed or not) and
is a weight function that gives each edge
a value
. this value is called the weight or length of the edge 
path length:
let
be a weighted graph, let
be a path in
, the length of the path
is defined as the sum of weights of the edges in the path:

let
distance between vertices:
for all
, the distance from
to
is defined as the length of the minimal path from
to
, i.e.
. (same definition as for unweighted graphs)
for all