[Scip] Best solution not feasible

Stefan Heinz heinz at zib.de
Tue Mar 5 12:12:01 MET 2013


Hi Steve,

Gerald and I just discussed your issue. First there is no bug and second 
your solutions are (most likely) all feasible :-).

Now what is going on:

During the solution process the variable domains are getting smaller and 
smaller. What does that mean. Assume you are branching in the root node 
on a binary variable x. If the sub-tree with x = 0 is completely 
processed, SCIP will change the global lower bound of this variable to 
1. As a result all solutions which are detected in the sub-tree x = 0 
(and having x assigned to 0) are infeasible from that point on. As a 
result, you cannot check solutions later in the transformed space (since 
it gets smaller and smaller until it is empty) which is usually okay 
since the original space exits. In your case, however, the original 
space is meaningless because the priced in variables are missing. 
Therefore, you have no chance to check your solutions within the SCIP 
environment.

Does that make sense for you?

Are you checking the solution within the SCIP environment or are you 
checking the solutions by yourself?

Best Gerald and Stefan



On 03/05/13 07:45, Stephen J Maher wrote:
> Hi Gerald,
>
> I have output the transformed problem following the SCIPfreeSolve() and
> all of the priced in variables are still present.
>
> The way that I get the values for the variables is calling
> SCIPgetBestSol() and then using SCIPgetSolVals() for each of the
> variables. I am doing all this prior to calling SCIPfreeSolve(). Once
> SCIPfreeSolve() is called, you no longer see the priced in variables
> when calling SCIPprintBestSol(). This is the same for all solutions that
> are stored, which are extracted by SCIPprintSol().
>
> I have not placed anything in the EXITSOL callback for my plugins. I am
> using both a pricer and probdata.
>
> I hope that this helps. If you need anything else, please let me know.
>
> Cheers,
>
> Steve
>
>
>
> On 04/03/13 20:44, Gerald Gamrath wrote:
>> Hi Steve,
>>
>> I had a look into scip.c, but I'm not sure what might have happened in
>> your case. But here are some things we can check:
>>
>> 1) Can you print out the transformed problem after the SCIPfreeSolve()
>> call via SCIPprintTransProblem() to check whether the priced-in
>> variables are still present?
>>
>> 2) How do you get the solution values of the variables in the solution?
>> In particular, how do you get the variables for whose values you ask? If
>> you use SCIPgetOrigVars(Data), this won't give you the priced-in
>> variables, on the other hand, SCIPgetVars(Data), should give you all
>> transformed variables, including priced-in ones. You should be able to
>> check via SCIPvarIsTransformedOrigvar() whether a transformed variable
>> belongs to some original variable or was priced in. What does the
>> solution look like when you print it using SCIPprintBestSol() (or
>> better, print all solution using SCIPprintSol() on each one)?
>>
>> 3) In SCIPfreeSolve(), the EXITSOL callback of all plugins are called,
>> could it be that you release some data there that you actually want to
>> keep (e.g., in your pricer or problem data)?
>>
>> Best,
>> Gerald
>>
>> On 04.03.2013 07:20, Stephen J Maher wrote:
>>> Hi all,
>>>
>>> I have been looking into this a little further to identify what is
>>> happening. It appears that when SCIPfreeSolve() is called the
>>> transformed variables in the stored solutions are freed. So when
>>> SCIPgetBestSol() is called, only the original variables appear.
>>>
>>> At later iterations, if the transformed variables were still present,
>>> then the solutions would be feasible. So the solutions are feasible, but
>>> they just don't appear that they are. Unfortunately I don't know how to
>>> extract the best solution with the transformed and original variables.
>>>
>>> Cheers,
>>>
>>> Steve
>>>
>>>
>>>
>>> On 28/02/13 12:09, Stephen J Maher wrote:
>>>> Hi all,
>>>>
>>>> I am having some difficulty with SCIP returning the best solution from
>>>> the SCIPgetBestSol() function that is not feasible for my problem. In
>>>> addition, I am also checking the solution using SCIPcheckSol(), which
>>>> indicates that it is feasible.
>>>>
>>>> My solution process involves solving an IP using branch-and-price. Once
>>>> the optimal solution is found, I call SCIPfreeSolve(), update
>>>> information in my pricer to generate alternative columns, and then call
>>>> SCIPsolve(). This is repeated until no further updates are required.
>>>> This solution process is followed because all feasible solutions to
>>>> problems solved in previous iterations are feasible to the current problem.
>>>>
>>>> The first iteration is solved as expected. The following iterations are
>>>> also solved as expected, and the primal and dual bounds are correct.
>>>> However, from the second iteration there are solutions, collected using
>>>> SCIPgetSols() and tested with SCIPcheckSol(), that are not feasible for
>>>> the problem. In the set of solutions extracted from SCIP, the optimal
>>>> solution (the solution that provided the primal bound) does appear. This
>>>> optimal solution is not set as the best solution.
>>>>
>>>> I am not too sure whether I am using the SCIPfreeSolve() function in the
>>>> correct way. All that I want to do is delete all the branch-and-bound
>>>> information and then solve again having retained a set of feasible
>>>> integer solutions.
>>>>
>>>> Thanks a lot for your help,
>>>>
>>>> Steve
>>>>
>>> _______________________________________________
>>> Scip mailing list
>>> Scip at zib.de
>>> http://listserv.zib.de/mailman/listinfo/scip
>>
>>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list