table of contents

weighted graph

2023-04-12

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:

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)