[Cbc] provide initial column solution from command line?

Haroldo Gambini Santos haroldo at ufop.edu.br
Mon Sep 17 21:29:07 EDT 2018


Yes it is.

To solver  a.mps   entering as initial solution the solution stored in 
a.sol just use

cbc a.mps mips a.sol solve

The solution format is the same used by cbc, e.g.:

Optimal - objective value 6.00000000
       0 C                       6                       1
       1 f(1,1)                  1                       0
       8 x(2,3,1)                1                       0
      11 x(3,2,1)                1                       0

The first line is ignored.

In the remaining lines, only the second (variable name) and third 
(value) columns is read. You only have to inform the values of the 
non-zero integer variables.

Cheers,

Haroldo

On 9/17/18 9:26 PM, James Howey wrote:
>
> Is it possible?
>
> I have a model that quickly comes up with a weak integer solution. I 
> want to take that result and use it as the starting point for another 
> solve, same columns, tighter objective.
>
> My expectation is that, if I have a problem that arrives at optimum 
> after say 300 nodes, then I should be able to take the optimum 
> solution, and feed it back into cbc with the same problem and see an 
> immediate optimum reached.
>
> In efforts to achieve this demonstration, I have been working with the 
> “prio” command.
>
> I have a file formatted like this:
>
> name,solution
>
> E_draw(0),-100000
>
> E_draw(1),-111112.61
>
> E_draw(10),-109772.28
>
> Which I feed to cbc:
>
> cbc.exe c:\temp\store\lpmodel\1_292_279_2.lp -directory 
> c:\temp\store\lpmodel\ -preprocess on -prio 1_292_279_2.values -solve 
> -solu 1_292_279_2.val.out.solution –quit
>
> with no apparent effect. Is “solution” the right column header? It 
> seems to go straight to the linear solution ignoring the proffered 
> solution.
>
> I figured I would try the “force” command argument. With “-force 0” I 
> get the immediate result I seek, but unfortunately:
>
> 2 fields and 3855 records
>
> forceSolution was changed from -1 to 0
>
> Continuous objective value is 0 - 0.35 seconds
>
> Cbc0045I Solution with objective value 0 saved
>
> Cbc0006I The LP relaxation is infeasible or too expensive
>
> Cbc0045I Solution of 0 already found by heuristic
>
> Cbc0039I On closer inspection - solution discarded
>
> Cbc0039I On closer inspection - solution discarded
>
> Cbc0039I On closer inspection - solution discarded
>
> Cbc0021I On closer inspection node is infeasible
>
> Result - Linear relaxation infeasible
>
> Objective value: 
> 100000000000000007629769841091887003294964970946560.00000000
>
> Enumerated nodes:               0
>
> Total iterations:               0
>
> Time (CPU seconds):             1.06
>
> Time (Wallclock seconds):       1.06
>
> Other values for force don’t seem to do anything. I note the 
> solutionIn is initialized like so:
>
> if(got[6] >= 0) {
>
> solutionIn = reinterpret_cast<double*> (malloc(numberColumns * 
> sizeof(double)));
>
> for(iColumn = 0; iColumn < numberColumns; iColumn++)
>
> solutionIn[iColumn] = -COIN_DBL_MAX;
>
>              }
>
> I expect that is by design, but if sparsely specified values are left 
> at -COIN_DBL_MAX that would be bad?
>
> I have a bunch of SOS in the model. Do we have to turn the crank to 
> get SOS state to match the provided column values?
>
> Any tips or hints will be appreciated.
>
> Thanks,
>
> jkh
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cbc

-- 
=============================================================
Haroldo Gambini Santos
Computing Department
Universidade Federal de Ouro Preto - UFOP
email: haroldo at ufop.edu.br
home/research page: www.decom.ufop.br/haroldo


It has long been an axiom of mine that the little things are infinitely
the most important.
-- Sir Arthur Conan Doyle, "A Case of Identity"



More information about the Cbc mailing list