get number of solutions with

209 views
Skip to first unread message

Alessandro Danese

unread,
May 16, 2017, 6:10:12 AM5/16/17
to Gurobi Optimization

Hello to everyone.

Is it possibile count the number of feasible solutions of a set of constraints with gurobi?

Let's take as example two integers variables {x,y} and two constraints {x<=1; y<=1}.
The number of feasible solutions of the set of constraints is 4, namely {(0,0), (0,1),(1,0),(1,1)}.

Thanks!
Alessandro

Tim Chippington Derrick

unread,
May 16, 2017, 6:31:20 AM5/16/17
to gur...@googlegroups.com
In principle yes, but the numbers get very big very quickly. 10 binaries would give 1024. 20 variables gives over a million, 30 gives over a billion. 50 variables would lead to potentially 10**15 solutions, so at the rate of solving/rejecting maybe 1 million per second, it would take of the order of 35 years. Combinatorics bites very hard and fast. All the more amazing that these solvers can solve the problems that we throw at them so 'casually', because a 50 variable problem would be considered very tiny.

Tim

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dr Tim Chippington Derrick
Chippington Derrick Consultants Ltd
Tel: +44 01276 508949
Mob: +44 07971 997948

Michael Winkler

unread,
Jun 14, 2017, 12:55:36 PM6/14/17
to Gurobi Optimization, t...@chippingtonderrick.co.uk
You could use the PoolSearchMode together with PoolSolutions parameter to collect all solutions. See


https://www.gurobi.com/documentation/7.0/refman/poolsearchmode.html
https://www.gurobi.com/documentation/7.0/refman/poolsolutions.html#parameter:PoolSolutions

For a more detailed description see also:

https://www.gurobi.com/documentation/7.0/refman/solution_pool.html

Best,
Michael
Reply all
Reply to author
Forward
0 new messages