Template Function ADS::addEdge

Function Documentation

template<class D>
void ADS::addEdge(AllPairs<D> &R, int a, int b, const D &w)

the insertion of the edge ( a , b ) of cost w, O( n^2 )

Pre:

a and b are distinct places of R, and w + d[ b ][ a ] >= 0

Post:

d[ a ][ b ] <= w, and the distances are closed under the triangle inequality (audit)