Algolib
Data structures
Graphs
Data structures
Algorithms
Bellman Ford
BellmanFord
BFS
Dijkstra
Edmonds-Karp
Floyd-Warshall
Kosaraju
Kruskal
Min-Cut
Prim
Tarjan
To Bipartite
Topological sort
Geometry
Mathematics
Optimization
Sorting
Strings
Trees
Simplex
Two-SAT
JSON
Constants
Shortcuts
Utility
Algolib
Graphs
Algorithms
Bellman Ford
View page source
Bellman Ford
template
<
class
G
>
class
BellmanFord
Public Functions
inline
BellmanFord
(
const
G
&
g
,
const
std
::
vector
<
int
>
startVertice
)
inline
BellmanFord
(
const
G
&
graph
,
const
int
startVertex
)
inline
bool
hasNegativeCycle
(
)
const
inline
G
::
Weight
distTo
(
const
int
vertex
)
const
Private Members
std
::
vector
<
typename
G
::
Weight
>
m_dists
bool
m_hasNegativeCycle