メインコンテンツへスキップ

Adding a constant to the objective function can lead to a bug

回答済み

コメント

3件のコメント

  • Eli Towle
    • Gurobi Staff

    Did you manually add the - 94 to the objective function? Gurobi's LP reader interprets this as a variable named 94 with objective coefficient -1. This should instead be written as - 94 Constant with another constraint in the Bounds section fixing Constant to 1. However, we don't recommend manually editing model files, as it is prone to error.

    0
  • Riley Clement
    • Gurobi Staff

    It's also strange to see

    0 <= x7 <= 1
    0 <= x8 <= 1

    since Gurobi does not write lower bounds of 0 to file.  If a lower bound for a variable is not stated in the file then that variable has a lower bound of 0 - i.e. all your variables in this model have lower bounds of 0 (just in case this is not what you wanted).

    - Riley

    0
  • rui sa shibasaki
    • First Question
    • First Comment

    Ok, I understand now. Thanks.
    The thing is that I am comparing different solvers for one problem. The .lp was written out by one of them, and I am giving this .lp to the others. It turns out they do not read it all in the same way then.

    Thank you,
    Rui

    0

サインインしてコメントを残してください。