Good afternoon,
I am quite new to Python, and I have to solve a problem which has the need to try billions of hypothesis... More specifically I need to iterate a list of 440 elements, but I need to do it 8 times... (yes, the number os iterations is completly insane I know).
My machine is quite good, so I want to use the multiprocessing python functionalities to speed this up a lot.
Do you know any simple solution which would take profit from the processing capabilities from my machine?
Inputs:
ListPairs:
for ind1 in range(16,37):
for ind2 in range(16,37):
ListPairsAux = []
ListPairsAux.append(ind1)
ListPairsAux.append(ind2)
ListPairs.append(ListPairsAux)
For the simplicity of the problem, you can assume that both len(list1[i]) and len(list2[i]) are integers and both are equal to 198. (In the real problem we will actually have 21 different integers, but all in the same order - meaning that they won't go much further than 198.
The for loops are the ones below:
for first in ListPairs:
print(str(first))
for second in ListPairs:
for third in ListPairs:
for fourth in ListPairs:
for fifth in ListPairs:
for sixth in ListPairs:
for seventh in ListPairs:
sumA = first[0] + second[0] + third[0] + fourth[0] + fifth[0] + sixth[0] + seventh[0]
sumB = first[1] + second[1] + third[1] + fourth[1] + fifth[1] + sixth[1] + seventh[1]
for i in range(len(list1)):
if sumA == len(list1[i]) and sumB == len(list2[i]):
List7 = []
List7 = [first, second, third, fourth, fifth, sixth, seventh]
ListsOut[i].append(List7)
for eighth in ListPairs:
sumA = first[0] + second[0] + third[0] + fourth[0] + fifth[0] + sixth[0] + seventh[0] + eighth[0]
sumB = first[1] + second[1] + third[1] + fourth[1] + fifth[1] + sixth[1] + seventh[1] + eighth[1]
for i in range(len(list1)):
if sumA == len(list1[i]) and sumB == len(list2[i]):
List8 = []
List8 = [first, second, third, fourth, fifth, sixth, seventh, eighth]
ListsOut[i].append(List8)
Thank you so much!