title: Can brute force algorithms scale?
body: <p>I have a math problem that I solve by trial and error (I think this is called brute force), and the program works fine when there are a few options, but as I add more variables/data it takes longer and longer to run.</p>
  
  <p>My problem is although, the prototype works, it is useful with thousands of variables and large data sets; so, I'm wondering if it is possible to scale brute force algorithms. How can I approach scaling it?</p>
  
  <p>I was starting to learn and play around with <a href="http://en.wikipedia.org/wiki/Apache_Hadoop" rel="nofollow">Hadoop</a> (and <a href="http://en.wikipedia.org/wiki/HBase" rel="nofollow">HBase</a>); although it looks promising, I wanted to verify that what I'm trying to do isn't impossible.</p>
  
  <p>If it helps, I wrote the program in Java (and can use it if possible), but ended up porting it to Python, because I feel more comfortable with it.</p>
  
  <p><strong>Update:</strong> To provide more insight, I think I'll add a simplified version of the code to get the idea. Basically if I know the sum is 100, I am trying to find all combinations of the variables that could equal it. This is simple, in my version I may use larger numbers and many more variables. It's the Diophantine, and I believe there is no algorithm that exists to solve it without brute force.</p>
  
  <pre><code>int sum = 100;
  int a1 = 20;
  int a2 = 5;
  int a3 = 10;
  for (int i = 0; i * a1 &lt;= sum; i++) {
      for (int j = 0; i * a1 + j * a2 &lt;= sum; j++) {
          for (int k = 0; i * a1 + j * a2 + k * a3 &lt;= sum; k++) {
              if (i * a1 + j * a2 + k * a3 == sum) {
                System.out.println(i + "," + j + "," + k);
              }
          }
      }   
  }
  </code></pre>
  
  <p>I am new to programming, and I am sorry if I'm not framing this question correctly. This is more of a general question.</p>