Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
0 answers
124 views

Iterating over all simple unique cycles in an undirected graph in Java - brute-force approach

This post is about an Iterator iterating over simple loops of an undirected graph. In the above graph, the cycle \$\langle 1, 2, 3, 4, 5, 3, 1 \rangle\$ is not ...
coderodde's user avatar
  • 31k
7 votes
1 answer
3k views

An iterator returning all possible permutations of a list in Java

I have this class that iterates over all permutations of an input list: PermutationIterable.java: ...
coderodde's user avatar
  • 31k
4 votes
2 answers
5k views

Combination generator in Java - 2nd iteration

I have refactored the previous combination generator, and now it is an iterator returning combinations as lists. It hides larger constant factors as the previous version, yet it is really easy to use: ...
coderodde's user avatar
  • 31k