Defined in File TopologicalSort.hpp
public NetworKit::Algorithm
(Class Algorithm)
Given a directed graph G, the topology sort algorithm creates one valid topology order of nodes. Undirected graphs are not accepted as input, since a topology sort is a linear ordering of vertices such that for every edge u -> v, node u comes before v in the ordering.
Public Functions
Initialize the topological sort algorithm by passing an input graph.
G – The input graph.
Initialize the topological sort algorithm by passing an input graph and an node id map. The node id mapping must be a continuous. This can be checked by setting checkMapping to true.
G – The input graph.
nodeIdMapping – Node id mapping from non-continuous to continuous ids.
checkMapping – Check whether the given node id map is continuous.
Execute the algorithm. The algorithm is not parallel.