- Home /
Design discussion
How to do an absolutely massive calculation?
Hello and thanks for taking a look at my question.
Lately, I've been trying to create an algorithm that allows me to find the best possible combination of some parameters in a certain situation. Right now, I'm doing this by testing all the possible combinations. This, however, takes ages :p.
The amount of iterations that I'm doing is close to 900 million. This is not all of it yet, each iteration other methods are called that run trough multiple 2D arrays of 118x10 elements. So, you will actually be looking at an estimated 23600 subiterations.
Now, my question is: Is there a better way to check for certain elements in a 2D array other than just iterating through them? It think it would vastly improve the performance.
Thanks again for taking your time to look at my question, any answers are very much appreciated.
At this high a level, Unity Answers is not the right place to ask this question. Unity Answers focus on single, specific technical problems. We ask that design/discuss problems be asked on Unity Forums. Given the nature of the problem, someplace like Stackoverflow or a game design forum might be an even better fit.
There are a number of algorithms for organizing positions for faster searching. The best ones take advantage of some property of the data, so you may need to explain the nature of the position you are storing to get the best answer.
If your problem can be subdivided, consider using multiple threads.