[Cbc] provide initial column solution from command line?

John Forrest john.forrest at fastercoin.com
Wed Sep 19 11:46:35 EDT 2018


James,

I have modified trunk -

a) there was a bug so a bad SOS solution got through.
b) it is not totally simple to fix an SOS solution e.g. if in the input 
solution a SOS2 has just one variable nonzero - do you only allow that 
one or allow one next to it - if so which way?

I have tried to make some improvements.

John

On 18/09/18 05:19, James Howey wrote:
> Thanks for putting me on the right track. I was completely innocent of the
> mipstart feature. Alas, it still doesn't work.
>
> Is it possible that my use of sos is the problem? I don't have any integer
> values, but I do have:
>
> 	0 variables in SOS1 sets made integer, 240 non integer in SOS1, 120
> in SOS2
>
> Maybe SOS state is not taken into account?
>
> jkh
>
> command line - cbc.exe 1_292_279_2.lp -mips 1_292_279_2.val.out.solution
> -solve -quit (default strategy 1)
>   CoinLpIO::readLp(): Maximization problem reformulated as minimization
> opening mipstart file .\1_292_279_2.val.out.solution.
> MIPStart values read for 3855 variables.
> Continuous objective value is 0 - 0.22 seconds
> 0 variables in SOS1 sets made integer, 240 non integer in SOS1, 120 in SOS2
>
> Cgl0004I processed model has 1371 rows, 3171 columns (0 integer (0 of which
> binary)) and 11783 elements
> Cbc0045I Trying just fixing integer variables.
> Cbc0045I MIPStart provided solution with cost 0
> Cbc0006I The LP relaxation is infeasible or too expensive
> Cbc0045I Solution of 0 already found by heuristic
> Cuts at root node changed objective from 1.79769e+308 to -1.79769e+308
> <snip>
> Result - Linear relaxation infeasible
>
> Objective value:
> 100000000000000007629769841091887003294964970946560.00000000
> Enumerated nodes:               0
> Total iterations:               0
> Time (CPU seconds):             0.60
> Time (Wallclock seconds):       0.60
>
> Total time (CPU seconds):       0.91   (Wallclock seconds):       0.91
>
> -----Original Message-----
> From: Haroldo Gambini Santos [mailto:haroldo at ufop.edu.br]
> Sent: Monday, September 17, 2018 6:29 PM
> To: James Howey <james.howey at gmail.com>; cbc at list.coin-or.org
> Subject: Re: [Cbc] provide initial column solution from command line?
>
> 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"
>
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cbc
>
>



More information about the Cbc mailing list