Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presolve error #282

Closed
mckib2 opened this issue Mar 31, 2020 · 9 comments
Closed

Presolve error #282

mckib2 opened this issue Mar 31, 2020 · 9 comments
Assignees

Comments

@mckib2
Copy link
Contributor

mckib2 commented Mar 31, 2020

Related to #13 , possibly #280

Solving simple problem:

c = [-3. -2.]
A=   (0, 0)     2.0
  (1, 0)        1.0
  (2, 0)        1.0
  (0, 1)        1.0
  (1, 1)        1.0
rhs= [10.  8.  4.]
lhs= [-inf -inf -inf]
lb= [0. 0.]
ub= [inf inf]
options= {'presolve': True, 'sense': 1, 'solver': 'simplex', 'parallel': False, 'time_limit': 1, 'message_level': 1}

results in the error message:

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
Aborted (core dumped)

Solution is incorrectly reported when presolve=False as [0, 8], should be [2, 6].

However, [2, 6, (undefined)] is the reported answer when transpose(A) is used, with and without presolve enabled (sometimes fails because 3rd value is undefined). Is there something I'm not understanding about the interface? Because the dimensions of A don't seem like they work like that.

@galabovaa
Copy link
Contributor

It is not that you are missing something, we have bugs we need to clear out and your examples are very helpful. Lots of changes have happened recently and we need to do some bug fixing, I will look into the example asap. Again, better docs will be available soon. Until then yes, the infinity value may cause a problem.

@galabovaa
Copy link
Contributor

Why do you think it is linked to #13? The problems causing the issue there presolve OK and I just ran the code again and got no errors.

@mckib2
Copy link
Contributor Author

mckib2 commented Mar 31, 2020

Error message from #13 is the same, could be that it is not related. Do you have an idea of which infinity values may be causing the issue?

@mckib2
Copy link
Contributor Author

mckib2 commented Mar 31, 2020

Please let me know if there's a better way for me to report problems, is MPS better or just a description like above sufficient?

@galabovaa
Copy link
Contributor

Thank you, our tests (including interface tests) are WIP so if you have an mps available that would be great!

@jajhall Do you know which infinity values may cause problems? I remember there was a case like that but not the details and I don't know whether you fixed that already.

@jajhall
Copy link
Member

jajhall commented Mar 31, 2020

Related to #13 , possibly #280

Solving simple problem:

c = [-3. -2.]
A=   (0, 0)     2.0
  (1, 0)        1.0
  (2, 0)        1.0
  (0, 1)        1.0
  (1, 1)        1.0
rhs= [10.  8.  4.]
lhs= [-inf -inf -inf]
lb= [0. 0.]
ub= [inf inf]
options= {'presolve': True, 'sense': 1, 'solver': 'simplex', 'parallel': False, 'time_limit': 1, 'message_level': 1}

results in the error message:

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
Aborted (core dumped)

Solution is incorrectly reported when presolve=False as [0, 8], should be [2, 6].

However, [2, 6, (undefined)] is the reported answer when transpose(A) is used, with and without presolve enabled (sometimes fails because 3rd value is undefined). Is there something I'm not understanding about the interface? Because the dimensions of A don't seem like they work like that.

You can't just transpose A since its dimensions must be consistent with c, rhs, lhs, lb and ub

That said, I don't see how you get from the problem definition you give, and HiGHS. What is the value of inf? Or, more precisely, what value for inf reaches HiGHS?

@mckib2
Copy link
Contributor Author

mckib2 commented Mar 31, 2020

You can't just transpose A since its dimensions must be consistent with c, rhs, lhs, lb and ub

This is why I am confused about results.

That said, I don't see how you get from the problem definition you give, and HiGHS. What is the value of inf? Or, more precisely, what value for inf reaches HiGHS?

Value of inf is HIGHS_CONST_INF. The problem is passed through the Cython wrapper scikit-highs that we are working on for inclusion in scipy. scikit-highs is built on top of the C API.

I will generate an MPS file that describes the problem later today.

@jajhall
Copy link
Member

jajhall commented Mar 31, 2020

You've got a fault because you're not using the up-to-date version of the C API. When I was improving HiGHS/examples/call_highs_from_c.c the other day, I decided to use an example with 3 rows and 2 columns, and got a fault due to the following lines in src/interfaces/highs_c_api.cpp

lp.rowLower_.assign(rowlower, rowlower + numrow);
lp.rowUpper_.assign(rowupper, rowupper + numcol);

The second should say "+ numrow);"

@mckib2
Copy link
Contributor Author

mckib2 commented Mar 31, 2020

I just pulled in all the recent commits from master, C API now provides the expected results. Thank you both for helping me troubleshoot that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants