title: Prevent memory error in itertools.permutation
body: <p>Firstly I would like to mention that i have a 3 gb ram. </p>
  
  <p>I am working on an algorithm that is exponential in time on the nodes so for it I have in the code </p>
  
  <pre><code>perm = list( itertools.permutations(list(graph.Nodes))) # graph.Nodes is a tuple of 1 , 2 , ... n integers
  </code></pre>
  
  <p>which generates all the combinations of vertices in a list and then i can work on one of the permutation.</p>
  
  <p>However when i run the program for 40 vertices , it gives a memory error.</p>
  
  <p>Is there any simpler way in implementation via which i can generate all the combinations of the vertices and not have this error.</p>