C code for Johnson's 1975 algorithm to find elementary cycles in directed graph