Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there any way to form combinations in parts ?

What I want to say will be clear from this.

Suppose I run this code:

T = Tuples((0,1),4)
comb= Combinations(T,5)
show(comb.cardinality())

The output is

4368

My concern is this that I have to use these combinations further in my code. The problem is that for 4-tuples of (0,1) the processing is instant(because only 4368 combinations), but for 300-tuples of (0,1) even after many hours it is still processing. So, I was thinking that is it possible to form combinations in parts in different codes and run these codes separately so that output is faster.

What I mean to say is that, in the above code for example, is it possible that only first, say 10% (that is 437) of the combinations are formed. Then in another code the next 10%(that is 437th to 974th) combinations are formed and so on. Or is there any other way to make this faster

Is there any way to form combinations in parts ?

What I want to say will be clear from this.

Suppose I run this code:

T = Tuples((0,1),4)
comb= Combinations(T,5)
show(comb.cardinality())

The output is

4368

My concern is this that I have to use these combinations further in my code. The problem is that for 4-tuples of (0,1) the processing is instant(because only 4368 combinations), but for 300-tuples of (0,1) even after many hours it is still processing. So, I was thinking that is it possible to form combinations in parts in different codes and run these codes separately so that output is faster.

What I mean to say is that, in the above code for example, is it possible that only first, say 10% (that is 437) of the combinations are formed. Then in another code the next 10%(that is 437th 438th to 974th) combinations are formed and so on. Or is there any other way to make this faster