C++ Detect cycles in a Graph with indegrees
Posted on May 22nd, 2013 by Cédric VerstraetenSome algorithms only work in graphs without cycles, that’s why we need an algorithm to detect if a graph has a loop. We introduce following graph: The detect cycle class #ifndef __lus__ #define __lus__ #include “graaf.h” #include <vector> #include <queue> namespace lu{ template <GraafType TYPE> class lus { public: lus(Graaf<TYPE>&); bool is_lus_ingraden(); private: Graaf<TYPE> * [...]
