/* Library for graph structure analyze * Usage: * graph_analyze (N, connect, max_depth) */ #include #include #include int check_cycle (const int N, const int *matrix) // function to return number of cycles { int cycle, i, j; /* cycle - number of cycle */ cycle = 0; for (i=0; i N) depth = N; else depth = max_depth; n_cycle = (int *) malloc ((max_depth-2) * sizeof (int)); tail = check_tail (N, matrix); cycle = check_cycle (N, matrix); if (cycle > 0) for (i=0; i