Conversation
|
Yep, seems weird, but I wasn't at the basement meeting where MPS was figured out. I found some old CPLEX manuals stating "a warning will be issued and the most recently assigned value will be used", which sounds about right for a punch card format. I'll see if anyone here remembers. For an old format it seems maybe logical to follow the oldest of solvers ... is Cbc erroring out, or just printing messages? |
|
Cbc properly errors: The Gurobi docs don't mention anything about repeated entries: https://docs.gurobi.com/projects/optimizer/en/current/reference/fileformats/modelformats.html#columns-section I think for now I stand by the decision to sum. I can't think of any situation in which a user is intentionally adding repeated entries to use only the last one, or where they expect an error. We will also never write repeated entries, so this applies only to models that we're reading from external source, and it seems like files with repeated entries are not well formed. |
Neither will Gurobi, but reading MPS files from other sources is already a bit of a minefield with inconsistencies galore.
Isn't that a stronger argument for erroring out? Seems like the best way to avoid ambiguous comparisons where the field isn't consistent. |
Maybe you're right. I'll take a look. I hate file formats without a schema. If you want to push something inside Gurobi... we'd love for people to adopt https://github.com/jump-dev/MathOptFormat |
|
I added a check for the duplicates, and it broke some other tests. Making it error would be a breaking change (although it could be regarded as a bug fix). I think I'm willing to leave the summing behavior as-is. There's also a performance hit to have to check for duplicates. People writing MPS files with duplicate columns already do so at their own risk. |
Closes #2786
It's not obvious what the right thing to do here is.
Gurobi ignores the repeated coefficients:
Cbc says:
So should we keep the current behavior or change to an error? Gurobi throwing a warning but solving an arbitrary (which one did it ignore!!!) problem seems like a massively wrong choice. (cc @simonbowly)