I have given up the approach with the permutations since it seems like a dead end. I'm working on a different approach now.
Type: Posts; User: andreas90
I have given up the approach with the permutations since it seems like a dead end. I'm working on a different approach now.
As I said in my previous post this will effect the computational time of the program.
In each run of the algorithm, the method that creates the permutations is called many times. Therefore the...
Thanks for your suggestion.
Unfortunately, at some point I'll need all the permutations together in the ArrayList to do some stuff with them, so the exception may be avoided when I'm generating them...
Unfortunately I need the combinations/permutations themselves. Finding the number of them was a "trick" to improve the time and memory usage. ie using an ArrayList with initial size (which is the...
Hello aesguitar!
You are right about my RAM, it's 3GB. As you can see from the code I posted I keep the permutations, not combinations. My new approach involves finding the combinations (which are...
Hello Z!
Thanks for the time you spent on my problem. I tried calculating P(n,r) as you suggested and it worked as I thought. I don't get a java.lang.OutOfMemoryError exception in the internal...
The number of permutations is P(n,r) = n!/(n-r)!
So for n=60 and r=4 I have P(60,4) = 60! / (60 - 4)! = 11703240 permutations.
I tried the same method with each quadraplet being a String instead...
I didn't explain well what I'm doing. This is the method that causes the java.lang.OutOfMemoryError exception I posted in post#2. I generate P(n,r) permutations which for the following method is...
It should be equal to the number of the permutations , if I'm getting right what you asked.
You mean if I need all the permutations? Yes, I need them because I want to search every possible...
When I try to solve a large instance of the problem I get the following error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown...
Hello guys!
I'll give you the big picture of what I'm doing. I'm solving a combinatorial optimization problem. I find an initial solution and then try to improve it with some heuristics. One of...