gdtore.blogg.se

Matlab optimization toolbox bitstring vs. double
Matlab optimization toolbox bitstring vs. double







matlab optimization toolbox bitstring vs. double

So, I'll discuss a more direct and more general approach here. Of course, this finding of combinations is no easy feat, and the whole method breaks down anyway if you are dealing with int16: ans = 2.311325368800510e+018 ~740 million evaluations of your relatively simple f(s) shouldn't take more than 2 seconds, and having found all s that maximize f(s), you are left with the problem of finding linear combinations in your vector set that add up to one of those solutions s. Possible vectors s (give or take a few, haven't thought about +1's etc.). Depending on the specifics of the lock, there may be multiple keys that fitīased on Rasman's approach and Phpdna's comment, and the assumption that you are using int8 as data type, under the given constraints there are > d = double(intmax('int8')).some of the pin's positions will be blocked, depending on the positions of all the other pins.The Matlab Optimization toolbox didnt help either since it doesnt much support for discrete optimization.īasically this is a lock-picking problem, where the lock's pins have 20 distinct positions, and there are 12 pins. The vectors are quite sparse, about 70-90% are zeros. Where f is a nonlinear function that takes the vector s and returns a scalar.īruteforcing takes too long because there are about 5.9 trillion combinations, and since i need the maximum (or even better the top 10 combinations) i can not use any of the greedy algorithms that came to my mind.

matlab optimization toolbox bitstring vs. double

In addition i have constraints for some components of that sum.Įxample: a_1 =, a_2 =, a_3 =. I have 12 sets of vectors (about 10-20 vectors each) and i want to pick one vector of each set so that a function f that takes the sum of these vectors as argument is maximized.









Matlab optimization toolbox bitstring vs. double