Improving the running speed...

asked 4 years ago

phcosta gravatar image

updated 4 years ago

Is it possible to get faster running if one applies a kind of multiprocessing to the example below?

L = Permutations(10)
K = factorial(10)
C = matrix(ZZ, 0, K)
d = []
for k in range(1, 10):
    B = Arrangements([1 .. 10], k)
    A = matrix(ZZ, [[all(p[i - 1] == u for i, u in zip(ii, uu))
                     for p in L] for ii in B for uu in B])
    C = C.stack(A)
    d.append(N-C.rank())
return d
Preview: (hide)

Comments

2

The matrix A has size (10!(10k)!)2×10!. For example, when k=9, it has 10!3265 elements, and there is no way you can fit it into memory

Max Alekseyev gravatar imageMax Alekseyev ( 4 years ago )

Thank you.

phcosta gravatar imagephcosta ( 4 years ago )