From 9d4394e359e69010114c1ddbef8a9e7fb53c5f9e Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sat, 29 Nov 2025 17:01:50 +0100 Subject: Add/update/reset files --- src/cycleDetection.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/cycleDetection.h (limited to 'src/cycleDetection.h') diff --git a/src/cycleDetection.h b/src/cycleDetection.h new file mode 100644 index 0000000..e1b62e0 --- /dev/null +++ b/src/cycleDetection.h @@ -0,0 +1,13 @@ +#ifndef CYCLEDETECTION_H +#define CYCLEDETECTION_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 cycleDetection(Graph *g); + +#endif // CYCLEDETECTION_H -- cgit v1.2.3-70-g09d2