[SCIP] Gain performance with plugin

Julain Stebler julianstebler at gmail.com
Thu Mar 30 21:28:54 CEST 2017


Hello Everybody

I like your Python interface for the SCIP Optimization Suite. And I would
like to learn more about the plugins. For that I try to solve following
Election Problem:

I have a grid with the size of 10x10 (100 pieces/states). Every piece
represents a state and every state has votes.
Votes for democrats and votes for republicans. The votes for the
republicans are two times higher.
The sum of ten states defines which party wins the vote for the
constituency. So there are 10 constituency.
The goal is that the party with the lower number of votes wins the most
 constituency more precisely wins the election.
Now to make the whole part more trickier, I want that the constituency are
all aside. Which means the constituency grid should look something like
this:
[1, 1, 1, 1, 2, 2, 2, 5, 5, 6
 1, 1, 1, 1, 1, 2, 2, 2, 5, 6
 1, 4, 4, 4, 4, 2, 2, 2, 5, 6
  3, 3, 4, 4, 4, 2, 5, 5, 5,6
 ....
 ....]
The number represents the number of the constituency which won the election.

To check if the winning constituency are aside I would like to use my own
constraint handler. But I do not know which method (
http://scip.zib.de/doc/html/CONS.php) I should use.
At the moment I implemented 'conscheck' and 'consenfolp'. But the time to
check the correctness is way to long.
I am not sure if this is possible, but I would like to call my handler for
every solution the solver sets the constituency of a state.

The code for my election problem with the handler can be found here:
https://gist.github.com/bhzunami/54cbc4f5ce37ba88e8c91d4ece0a4b56

If there is a better idea I am happy to hear it.
If something is not clear please ask back or make some comments in the gist.

Thank you for your help and time.

Kind regards
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20170330/2964aae9/attachment.html>


More information about the Scip mailing list