another way to enumerate all possible integer solutions

120 views
Skip to first unread message

马彦锴

unread,
May 19, 2019, 4:57:56 AM5/19/19
to YALMIP
Dear Johan Löfberg
 I want to find all possible solutions of a problem which have limited solutions. I have noticed the way using the for-loop and add x~=value(x), which is usefull but not effictive. Because the constraints become larger and larger when the number of solutions is bigger, which make the time longer. So do you have some another way to solve this problem.
thanks
yankai ma
embed_enumeration.zip

Johan Löfberg

unread,
May 19, 2019, 5:54:15 AM5/19/19
to YALMIP

options.gurobi.PoolSearchMode=2;
options.gurobi.PoolSolutions=10000;
options.savesolveroutput = 1;
sol = optimize(Constraints,obj,options);
sol.solveroutput.result.pool

马彦锴

unread,
May 20, 2019, 3:38:27 AM5/20/19
to YALMIP
It did work. Thank you very much. 

Amir Reza Azmoode

unread,
Aug 30, 2019, 8:59:24 AM8/30/19
to YALMIP
Hi,
I have a problem with retrieving solutions. I have configured options as you said and I see gurobi tries for finding the number of solutions as the value of  "PoolSolutions" is set.
but I'm unable to retrieve solutions.
the link below, from guroubi documentation, says you must query "Xn" attribute for retrieving solutions. but in " Attributes Example" document, there is no " how-to " for querying attributes in Matlab. I couldn't access the "Xn" attribute or  "SolCount" attribute anyway and therefore no other solutions I could access.

what should I do?

retrieving solutions link:

Xn link:

Attribute example link:

Johan Löfberg

unread,
Aug 30, 2019, 9:02:41 AM8/30/19
to YALMIP
The only way to communicate with gurobi in yalmip is via options, and non-standard outputs via savesolveroutputs
Reply all
Reply to author
Forward
0 new messages