Firstly I would like to mention that i have a 3 gb ram.
I am working on an algorithm that is exponential in time on the nodes so for it I have in the code
perm = list( itertools.permutations(list(graph.Nodes))) # graph.Nodes is a tuple of 1 , 2 , ... n integers
which generates all the combinations of vertices in a list and then i can work on one of the permutation.
However when i run the program for 40 vertices , it gives a memory error.
Is there any simpler way in implementation via which i can generate all the combinations of the vertices and not have this error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…