cycleDetection

Detect cycles in graphs
Log | Files | Refs | README

cycleDetection.h (400B)


      1 #ifndef CYCLEDETECTION_H
      2 #define CYCLEDETECTION_H
      3 
      4 #include "Graph.h"
      5 
      6 // Runs Kahn's algorithm on the graph, and outputs 'CYCLE DETECTED!\n'
      7 // if a DAG cannot be created, or the vertices as a list fx. '4, 0, 1, 3, 2\n'
      8 // representing an ordering in the DAG.
      9 // The output is printed to stdout.
     10 // The input may be altered in the process.
     11 void cycleDetection(Graph *g);
     12 
     13 #endif // CYCLEDETECTION_H