aboutsummaryrefslogtreecommitdiff
path: root/src/cycle_detection.h
blob: df9607ec4be2328221facd5370b826a71dc2e1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef CYCLE_DETECTION_H
#define CYCLE_DETECTION_H

#include "graph.h"

// Runs Kahn's algorithm on the graph, and outputs 'CYCLE DETECTED!\n'
// if a DAG cannot be created, or the vertices as a list fx. '4, 0, 1, 3, 2\n'
// representing an ordering in the DAG.
// The output is printed to stdout.
// The input may be altered in the process.
void cycle_detection(Graph *g);

#endif // CYCLE_DETECTION_H