#this dictionary stores the scores of each combination of breakpoints
L=len(group)
N=2**len(group)
foriinxrange(N):#search over all possible (!) combinations of breakpoints, now memory-efficient!
bin_vector=list_one(L,i)#this gives the ith binary vector of length L
try:
assertlen(bin_vector)==len(group)
except:
print'problem: bin_vector not equal length to bp list!'
sys.exit(1)
#filtering out those which have breaks too close together
ifgood_path(bin_vector,group):
#this is the key step, so we break it apart a bit:
#in theory, a binary vector should map to exactly one path, which is the path from the first bp in 'group' to the end, where breakpoints are only allowed at those which are specified by bin_vector