Setting Constraint Priority before search?

15 views
Skip to first unread message

Miran

unread,
Feb 23, 2017, 7:32:23 AM2/23/17
to OscaR
Hi OscaR group,

I have created a model which basically tries to place N Queens, N Bishops, and N Rooks on a N ny N board, where pieces of the same type are not allowed to attack each other. 

In my first model I added all the constraint to the same model, which takes a lot of time to solve when N increases, and also when adding more Bishops.

A good strategy would be, instead of trying to solve all constraints at the same time, to split them, e.g. solve for Queens, then Rooks, and finally Bishops. 

Currently I am trying to do it by splitting the modelled, and passing the "occupied board positions" to the next. E.g. solve queens, and pass occupied places to the Rooks search. However, the current approach is pass the occupied positions manually, and then restart when there is not solution for the given solution of  Queens for example.

For this reason I wanted to ask if there is an easier way to do such a things in Oscar, e.g adding priorities of constraints before starting the search, such that some of them a solve before others during search? I have seen it is possible to add the strength of a constraint, but not priority.

Thanks,
Miran
Reply all
Reply to author
Forward
0 new messages