Class GraphDistance

Class Documentation

class GraphDistance

Public Functions

virtual ~GraphDistance() = default

Default destructor

edgeweight weightedDistance(const Graph &g, node u, node v) const

Returns the distance between u and v in Graph g i.e., the length of the shortest path between the two. Zero if u = v, maximal possible value if no path exists.

Parameters:
  • g – The graph.

  • u – Endpoint of edge.

  • v – Endpoint of edge.

Returns:

The distance between u and v.

count unweightedDistance(const Graph &g, node u, node v) const

Returns the number of edges on shortest unweighted path between u and v in Graph g.

Parameters:
  • g – The graph.

  • u – Endpoint of edge.

  • v – Endpoint of edge.

Returns:

The number of edges between u and v.