graph_analysis
Static Public Member Functions | List of all members
graph_analysis::algorithms::FloydWarshall Class Reference

Implements Floyd-Warshall algorithm. More...

#include <FloydWarshall.hpp>

Static Public Member Functions

static DistanceMatrix allShortestPaths (const BaseGraph::Ptr &graph, EdgeWeightFunction edgeWeightFunction, bool detectNegativeCycle=true)
 

Detailed Description

Implements Floyd-Warshall algorithm.

Parameters
controlexception throwing when a negative cycle is detected
Exceptions
bydefault std::runtime_error when a negative cycle has been detected
See also
"The Floyd–Warshall algorithm on graphs with negative cycles" (Stefan Hougardy, 2010)

Member Function Documentation

◆ allShortestPaths()

DistanceMatrix graph_analysis::algorithms::FloydWarshall::allShortestPaths ( const BaseGraph::Ptr &  graph,
EdgeWeightFunction  edgeWeightFunction,
bool  detectNegativeCycle = true 
)
static
Parameters
graphThe graph to search on
edgeWeightFunctionfunction that allows retrieving the weight of an edge
detectNegativeCyclewhether to throw as soon as a negative cycle has been detected

The documentation for this class was generated from the following files: