Is there a trivial way to identify all the cycles of a graph using its adjacency and/or incidence matrices?
yes, but I'm gonna degrade you for asking such a fucking trivial question
just take the trace of the nth power of the adjacency matrix to identify all cycles of length n. the nth power of the adjacency matrix at location i,j gives you the number of paths from i to j, so just use that on the diagonal, you fucking degenerate. learn to Google before you post fifth like this, just type "cycle adjacency matrix", jesus
>>8960610
I deserve it, spent a few hours trying to solve it without incidence matrix and when I thought about using that just got lazy didn't want to spend any more time thinking
>>8960628
Are you sure you know what the word "trivial" means?
It means easy to develop and do, not fast or efficient. You can just label all nodes with numbers, and brute force all cycles in which they are. To get a list of all the individual cycles, you then sort them by the lowest element in them and flip them, so the second step is the lowest possible of the two seconds you ca chose from. then you remove all duplicates.