I think there is a bug in the grCycleBasis function. I have a large edge matrix, a part of which is:
2 5
2 7
5 8
5 7
7 11
8 11
8 14
11 15
14 15

Clearly, there are three cycles in this graph. viz. 2-5-7-2, 5-7-11-8-5 and 8-11-15-14-8. However, the function fails to recognize these three cycles individually and returns 2-5-8-7-11-2 and 2-5-8-14-15-11-7-2, completely ignoring the edges 5-7 and {5-7,8-11} respectively. It happens for several other subsets also. Please suggest a solution.
Thank you.
p.s. It calculates the number of cycles correctly though.