21 #ifndef __ctkDependencyGraph_h
22 #define __ctkDependencyGraph_h
25 #if !defined(NO_SYMBOL_EXPORT)
26 #include "ctkCoreExport.h"
28 #define CTK_CORE_EXPORT
33 class ctkDependencyGraphPrivate;
75 void findPaths(
int from,
int to, std::list<std::list<int>* >& paths);
78 void findPath(
int from,
int to, std::list<int>& path);
Class to implement a dependency graph, converted to STL instead of Qt.
void setEdgeListToExclude(const std::list< int > &list)
bool topologicalSort(std::list< int > &sorted, int rootId=-1)
int numberOfEdges() const
Get the number of edges associated with current graph.
void printAdditionalInfo() const
virtual bool shouldExcludeEdge(int edge) const
void sourceVertices(std::list< int > &sources)
Retrieve all vertices with indegree 0.
bool cycleDetected() const
Return true if there is at least one cycle.
ctkDependencyGraph(int nvertices)
int numberOfVertices() const
Get the number of vertices associated with current graph.
void insertEdge(int from, int to)
int cycleOrigin() const
If a cycle has been detected, return the origin of the cycle otherwise 0.
virtual void processEdge(int, int)
Called each time an edge is visited.
virtual ~ctkDependencyGraph()
void findPaths(int from, int to, std::list< std::list< int > * > &paths)
void findPath(int from, int to, std::list< int > &path)
Retrieve the path between two vertices.
void setVerbose(bool verbose)
int cycleEnd() const
If a cycle has been detected, return the end of the cycle otherwise 0.
bool checkForCycle()
Traverse graph and check for cycle.
ctkDependencyGraphPrivate * d_ptr