private List<Set<Integer>> generateCombination(int n) {
        int input[] = new int[n];
        for(int i = 0; i < input.length; i++) {
            input[i] = i+1;
        }
        List<Set<Integer>> allSets = new ArrayList<>();
        int result[] = new int[input.length];
        generateCombination(input, 0, 0, allSets, result);
        Collections.sort(allSets, new SetSizeComparator());
        return allSets;
    }
Date 11/17/2015
@author Tushar Roy

Help Karp method of finding tour of traveling salesman.

Time complexity - O(2^n * n^2)
Space complexity - O(2^n)

https://en.wikipedia.org/wiki/Held%E2%80%93Karp_algorithm
src/com/interview/graph/TravelingSalesmanHeldKarp.java