[Osi] Question about function getRowPrice()

Matthew Galati magh at lehigh.edu
Sun May 24 09:18:53 EDT 2009


Since your problem is an integer program, it does not know how to calculate
duals. When you ask for the dual what exactly do you want back? The optimal
duals of an integer program is a research question that (as far as I
understand) nobody knows how to answer.

Do you want the dual solution to the LP relaxation? If so, solve the LP
first, then get the duals.

For OSI folks, you should probably change this to return an error and
warning message - rather than to quietly return 0.0.

Thanks,
Matt




Hi all,
>
> I tried to use function getRowPrice() to get the solution of dual solution
> from an IP problem. But I received the result contain all zero value. I
> don't know the reason why. Can anyone give me an suggestion?
>
>
> my IP problem is:
>
> *NAME EXAMPLE
> ROWS
>  N OBJ
>  L ROW1
>  L ROW2
>  L ROW3
> COLUMNS
>  INT1 'MARKER' 'INTORG'
>  COL1 OBJ 20
>  COL1 ROW1 1  ROW3 1
>  COL2 OBJ 20
>  COL2 ROW1 1  ROW2 1
>  COL3 OBJ 20
>  COL3 ROW2 1  ROW3 1
>  COL4 OBJ 5
>  COL4 ROW3 1
>  COL5 OBJ 5
>  COL5 ROW1 1
>  COL6 OBJ 5
>  COL6 ROW2 1
>  INT1END 'MARKER' 'INTEND'
> RHS
>  RHS ROW1 1
>  RHS ROW2 1
>  RHS ROW3 1
> ENDATA*
>
> and my code is:
>
> ...
>
> *model.setObjSense(-1);
> model.branchAndBound();
> //..................get dual solution................*
>
> *OsiSolverInterface * solver;*
>
> *if** (preProcess) {*
>
> *process.postProcess(*model.solver());*
>
> *// Solution now back in solver1*
>
> *solver = & solver1;*
>
> *} *
> *else** {*
>
> *solver = model.solver();*
>
> *}*
>
> *const double *dualSolution= solver->getRowPrice();
> int numberRows=model.getNumRows();
> int iRows;*
>
> *for(iRows=0;iRows<numberRows;iRows++){
>     double value=dualSolution[iRows];
>     std::cout<<value<<std::endl;
>   }*
>
> the result I got is (0,0,0).
>
> Thanks,
>
> Danh Hua
>
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20090524/c629ea4a/attachment.html>


More information about the Osi mailing list