[Symphony] Symphony on infeasible integer problems

Menal Guzelsoy megb at lehigh.edu
Tue Nov 3 13:20:37 EST 2009


Irit,

Thanks for the report. It was a minor bug with handling constraints
with range values. It is now fixed in stable version.

Menal.

Menal Guzelsoy
Industrial and Systems Engineering Dept.
Lehigh University
1610 4620455



On Tue, Nov 3, 2009 at 12:05 PM, Irit Katriel <Irit.Katriel at tibra.com> wrote:
>
> Posting on the list. Thank you.
>
>
> -----Original Message-----
> From: Ted Ralphs [mailto:ted at Lehigh.EDU]
> Sent: 03 November 2009 16:39
> To: Irit Katriel
> Subject: Re: Symphony on infeasible integer problems
>
> Hi Irit,
>
> Thanks for the detailed bug report. If you can either post this to the
> SYMPHONY mailing list or file a ticket, someone will look into it.
>
> Cheers,
>
> Ted
>
> On Tue, Nov 3, 2009 at 11:36 AM, Irit Katriel <Irit.Katriel at tibra.com> wrote:
>> Dear Professor Ralphs,
>>
>>
>> I am solving the maximization problem below (with all columns made integer).
>> It has no solution because of the first four constraints.
>>
>>
>>
>> I get the following, which is not a solution at all but claims to be an
>> optimal one:
>>
>>
>>
>> Solution Cost: -2.000000
>>
>> :+++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> User indices and values of nonzeros in the solution
>>
>> +++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>>       2      1.000
>>
>>       3      1.000
>>
>>
>>
>> Total Presolve Time: 0.000000...
>>
>> Value of solution: -2
>>
>> si->isProvenOptimal() = 1
>>
>>
>>
>> My code is below. I am using symphony v 5.2.
>>
>>
>>
>> Thank you for your help.
>>
>> Irit
>>
>>
>>
>>
>>
>>
>>
>> The matrix:
>>
>> 4 4 0 0
>>
>> 0 0 1 1
>>
>> 1 0 1 0
>>
>> 0 1 0 1
>>
>> 1 0 0 0
>>
>> 0 1 0 0
>>
>> 0 0 1 0
>>
>> 0 0 0 1
>>
>>
>>
>> The row_ub vector:
>>
>> 3
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 1
>>
>>
>>
>> The row_lb vector:
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 1
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>>
>>
>>
>>
>> The objective vector:
>>
>> 1  1  1  1
>>
>>
>>
>>
>>
>>
>>
>> #include "OsiSym/OsiSymSolverInterface.hpp"
>>
>> void try_symphony()
>>
>> {
>>
>>     int ROWS = 8;
>>
>>     int COLS = 4;
>>
>>
>>
>>       CoinPackedMatrix *matrix = new CoinPackedMatrix(true, 0.5, 0.0);
>>
>>
>>
>>       matrix->setDimensions(ROWS, 0);
>>
>>
>>
>>     CoinPackedVector vec;
>>
>>
>>
>>     vec.insert( 0, 4 );
>>
>>     vec.insert( 1, 0 );
>>
>>     vec.insert( 2, 1 );
>>
>>     vec.insert( 3, 0 );
>>
>>
>>
>>     vec.insert( 4, 1 );
>>
>>     vec.insert( 5, 0 );
>>
>>     vec.insert( 6, 0 );
>>
>>     vec.insert( 7, 0 );
>>
>>
>>
>>     matrix->appendCol( vec );
>>
>>     vec.clear();
>>
>>
>>
>>     vec.insert( 0, 4 );
>>
>>     vec.insert( 1, 0 );
>>
>>     vec.insert( 2, 0 );
>>
>>     vec.insert( 3, 1 );
>>
>>
>>
>>     vec.insert( 4, 0 );
>>
>>     vec.insert( 5, 1 );
>>
>>     vec.insert( 6, 0 );
>>
>>     vec.insert( 7, 0 );
>>
>>
>>
>>     matrix->appendCol( vec );
>>
>>     vec.clear();
>>
>>     vec.insert( 0, 0 );
>>
>>     vec.insert( 1, 1 );
>>
>>     vec.insert( 2, 1 );
>>
>>     vec.insert( 3, 0 );
>>
>>
>>
>>     vec.insert( 4, 0 );
>>
>>     vec.insert( 5, 0 );
>>
>>     vec.insert( 6, 1 );
>>
>>     vec.insert( 7, 0 );
>>
>>
>>
>>     matrix->appendCol( vec );
>>
>>     vec.clear();
>>
>>     vec.insert( 0, 0 );
>>
>>     vec.insert( 1, 1 );
>>
>>     vec.insert( 2, 0 );
>>
>>     vec.insert( 3, 1 );
>>
>>
>>
>>     vec.insert( 4, 0 );
>>
>>     vec.insert( 5, 0 );
>>
>>     vec.insert( 6, 0 );
>>
>>     vec.insert( 7, 1 );
>>
>>
>>
>>     matrix->appendCol( vec );
>>
>>
>>
>>     std::cout << "Rows: " << matrix->getNumRows()
>>
>>                 << " Cols: " << matrix->getNumCols() << std::endl;
>>
>>     double *row_lb = new double[ROWS];
>>
>>       double *row_ub = new double[ROWS];
>>
>>       double *col_lb = NULL;
>>
>>       double *col_ub = NULL;
>>
>>       double *objective = new double[COLS];
>>
>>
>>
>>
>>
>>     row_lb[0] = 0;
>>
>>     row_lb[1] = 0;
>>
>>     row_lb[2] = 1;
>>
>>     row_lb[3] = 1;
>>
>>
>>
>>     row_lb[4] = 0;
>>
>>     row_lb[5] = 0;
>>
>>     row_lb[6] = 0;
>>
>>     row_lb[7] = 0;
>>
>>
>>
>>     row_ub[0] = 3;
>>
>>     row_ub[1] = 1;
>>
>>     row_ub[2] = 1;
>>
>>     row_ub[3] = 1;
>>
>>
>>
>>     row_ub[4] = 1;
>>
>>     row_ub[5] = 1;
>>
>>     row_ub[6] = 1;
>>
>>     row_ub[7] = 1;
>>
>>
>>
>>     objective[0] = 1.0;
>>
>>     objective[1] = 1.0;
>>
>>     objective[2] = 1.0;
>>
>>     objective[3] = 1.0;
>>
>>
>>
>>     std::cout << "--------------------------------------------" <<
>> std::endl;
>>
>>     std::cout << "The matrix: " << std::endl;
>>
>>
>>
>>     for ( int row=0; row< ROWS; ++row )  // i = limit order index
>>
>>     {
>>
>>         for(  int col=0; col<COLS; ++col )  // j = deletion index
>>
>>             std::cout << matrix->getCoefficient(row,col) << " ";
>>
>>
>>
>>         std::cout << std::endl;
>>
>>     }
>>
>>
>>
>>     std::cout << std::endl;
>>
>>     std::cout << "The row_ub vector: " << std::endl;
>>
>>     for ( int i=0; i< ROWS; ++i )
>>
>>         std::cout << row_ub[i] << std::endl;
>>
>>     std::cout << std::endl;
>>
>>
>>
>>     std::cout << "The row_lb vector: " << std::endl;
>>
>>     for ( int i=0; i< ROWS; ++i )
>>
>>         std::cout << row_lb[i] << std::endl;
>>
>>     std::cout << std::endl;
>>
>>
>>
>>     std::cout << std::endl;
>>
>>     std::cout << "The objective vector: " << std::endl;
>>
>>     for ( int i=0; i< COLS; ++i )
>>
>>         std::cout << objective[i] << "  ";
>>
>>     std::cout << std::endl;
>>
>>
>>
>>     std::cout << std::endl;
>>
>>     std::cout << "--------------------------------------------" <<
>> std::endl;
>>
>>
>>
>> /**************************************/
>>
>>
>>
>>       OsiSymSolverInterface *const si = new OsiSymSolverInterface;
>>
>>       si->messageHandler()->setLogLevel(0);
>>
>>     std::cout << "Assign Problem" << std::endl;
>>
>>       si->assignProblem(matrix, col_lb, col_ub, objective, row_lb, row_ub);
>>
>>       si->setObjSense(-1); // 1 min, -1 max
>>
>>     for (unsigned int i=0; i<COLS; ++i)
>>
>>         si->setInteger(i);
>>
>>
>>
>>     std::cout << "Initial Solve Problem" << std::endl;
>>
>>       si->initialSolve();
>>
>>     std::cout << "Value of solution: " << si->getObjValue() << std::endl;
>>
>>     std::cout << "si->isProvenOptimal() = " << si->isProvenOptimal() <<
>> std::endl;
>>
>>
>>
>>       const double *t = si->getColSolution();
>>
>>       for (unsigned int i=0; i<COLS; ++i)
>>
>>             if ( !((t[i]<1e-2) || (t[i]>1-(1e-2))) )
>>
>>                   std::cout << t[i] << std::endl;
>>
>>
>>
>>       delete si;
>>
>>       delete matrix;
>>
>>       delete[] row_lb; delete[] row_ub; delete[] col_lb; delete[] col_ub;
>> delete[] objective;
>>
>> }
>>
>
>
>
> --
> Dr. Ted Ralphs
> Associate Professor, Lehigh University
> (610) 628-1280
> ted 'at' lehigh 'dot' edu
> coral.ie.lehigh.edu/~ted
>
> The contents of this email including any attachments are confidential.  If you have received this email in error, please advise the sender by return email and delete this email.  Any unauthorised use of the contents of the email is prohibited and you must not disseminate, copy or distribute the message or use the information contained in the email or its attachments in any way.
>
> The views or opinions expressed are the author's own and may not reflect the views or opinions of Tibra. Tibra does not guarantee the integrity of any emails or attached files. E-mails may be interfered with, may contain computer viruses or other defects. Under no circumstances do we accept liability for any loss or damage which may result from your receipt of this message or any attachments.
>
>
> _______________________________________________
> Symphony mailing list
> Symphony at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/symphony
>





More information about the Symphony mailing list