﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	revision
334	MIP solver gives wrong solution	Akos Ladanyi	Balazs Dezso	"The program below gives {{{x=1, y=0}}} as solution with LEMON 1.1.1, but with [9cc6e98c487d] the solution is {{{x=1, y=1}}} (both with Glpk and Cbc).

{{{
#include <iostream>

#include <lemon/glpk.h>
#include <lemon/cbc.h>

int main()
{
    typedef lemon::GlpkMip MIP;
    //typedef lemon::CbcMip MIP;

    MIP mip;

    MIP::Col x, y;
    x = mip.addCol();
    y = mip.addCol();

    MIP::Expr e(x - 1.0);
    mip.addRow(e <= y);

    mip.colLowerBound(y, 0.0);

    mip.colType(x, MIP::INTEGER);
    mip.colBounds(x, 1.0, 2.0);

    mip.obj(y);
    mip.min();

    if (mip.solve() != MIP::SOLVED ||
        mip.type() != MIP::OPTIMAL)
    {
        std::cout << ""could not solve it"" << std::endl;
        return 0;
    }

    std::cout << ""x="" << mip.sol(x) << std::endl;
    std::cout << ""y="" << mip.sol(y) << std::endl;

    return 0;
}
}}}"	defect	closed	critical	LEMON 1.2 release	core	hg main	fixed			9cc6e98c487d
