Algolib
Data structures
Graphs
Data structures
Algorithms
Bellman Ford
BFS
Dijkstra
Edmonds-Karp
Floyd-Warshall
Kosaraju
Kruskal
Min-Cut
Prim
Tarjan
To Bipartite
Topological sort
TopologicalSort
Geometry
Mathematics
Optimization
Sorting
Strings
Trees
Simplex
Two-SAT
JSON
Constants
Shortcuts
Utility
Algolib
Graphs
Algorithms
Topological sort
View page source
Topological sort
template
<
class
G
>
class
TopologicalSort
Public Functions
inline
TopologicalSort
(
const
G
&
g
)
inline
bool
isPossible
(
)
const
inline
const
std
::
vector
<
int
>
&
topologicalSort
(
)
const
Private Members
bool
m_isPossible
std
::
vector
<
int
>
m_topologicalSort
std
::
vector
<
int
>
m_states