networkx/networkx — pull request #889 by Friedsoap (2013-06-14 21:05:00+00:00)
Title: Added new generator function equivalent to simple_cycles

This pull request implements a new generator function which is equivalent to simple_cycles (called simple_cycles_generator). The idea sparked when trying to speed up the function in https://github.com/networkx/networkx/pull/874 and the use of a generator function as a means to to avoid memory errors for graphs with lots of cycles was also suggested in https://github.com/networkx/networkx/pull/888.

The original algorithm is recursive and the transformation into a generator function preserves the recursive structure. (For an example of a recursive generator structure, see http://stackoverflow.com/questions/6694404/help-understanding-how-this-recursive-python-function-works/6694827#6694827).

Any comments on the code are most welcome.

Also, I would like to add the filtering options implemented in https://github.com/networkx/networkx/pull/888 to this new generator function but I am not sure how it works regarding the work flow. Here, I just implemented the generator function mimicking the original algorithm, should I create another branch for the generator function with filtering options? or is it maintainer work to do this kind of merging?