Monday, 12 August 2013

Group randomly List of Lists as N subsets with K elements in each

Group randomly List of Lists as N subsets with K elements in each

I have the following list of lists List<List<Integer>>
1 2
3
4 5 6
7
8
9
10
I have to group randomly this list of lists as 3 subsets with 4 elements
each (nevermind that in the last subset i'll have less than 4 elements),
and in every subset i cant have elements from the same row ( i cant have 3
4 5 7 for example). What should be the basic algorithm????

No comments:

Post a Comment