title: Generating a very high number of Combinations in R
body: <p>I have around 700 elements and want to create combinations of 20. The total number of combinations possible are [700 C 20] ~ 2.5e+38 combinations. This large dataset belongs to the specifications of a graph. This is a graph optimization problem, so, I would even like to apply the constraints to this set of combinations.</p>
  
  <p>I'm using R! for this purpose due to it's rich range of packages and large dataset handling capabilities. I'm using the 'combinat' package. The problem though, is, when I try to compute this, I'm getting the following error:</p>
  
  <pre><code>combn(theDataSet,20,myFunction)
  Error in matrix(r, nrow = len.r, ncol = count) : 
    invalid 'ncol' value (too large or NA)
  In addition: Warning message:
  In combn(theDataSet, 20, myFunction) : NAs introduced by coercion
  </code></pre>
  
  <p>Any solutions, alternate packages or algorithms to this problem is appreciated. Perhaps any method of handling the result?</p>
  
  <p>And since this is graph optimization problem, any packages or algorithms related to this is very much appreciated too.</p>
  
  <p>Or if any other tools that are available for solving such a problem, please tell me.</p>
  
  <p>I'm an electronics major, so I don't know much of the advanced algorithms for graph optimizations and I had to take the combinatorial approach. If there are more intelligent approaches to this problem, I would love to know.</p>
  
  <p>Help, please.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Since some of you have been asking for the actual problem, I'll just give an abstract of it, since posting my actual homework problems on the internet for line-to-line answers is not honourable.</p>
  
  <p>ABSTRACT:</p>
  
  <p>There are about 700 nodes, each of which have to recharged everyday by robots. The robots       (which are placed inside a dome) carry a source which has about 5000 units of energy and the each node requires different energy levels (Average requirement of all the nodes is around 250, but it ranges from 120 units to 500 units for some of the nodes). The distance from the nodes to the dome and the distance from a node to every other is given (in a matrix form of dimension 701x701).There are constraints for how much each robot can travel in a day. Design an algorithm and write a program (in any commercially available specifications or packages) to efficiently calculate the number of robots required and the total distance travelled by all the robots.</p>