forum.alglib.net
http://forum.alglib.net/

Solving multiple linear programming problems
http://forum.alglib.net/viewtopic.php?f=2&t=4471
Page 1 of 1

Author:  tonyturtletwn [ Fri Jul 15, 2022 3:26 pm ]
Post subject:  Solving multiple linear programming problems

Hi,

I am trying to solve multiple linear programming problems in a project, each having different constraints, number of variables, etc.

I tried creating multiple minlpstate structures and follow the procedures as mentioned in the basic example (https://www.alglib.net/translator/man/manual.cpp.html#example_minlp_basic) to solve each of them.

This would work if the number of problems is small (around 5 to 10), but eventually an error would occur if more problems are involved, leading to an error message "terminate called after throwing an instance of 'alglib::ap_error' ".

The function minlpsetbc seems to be the culprit of this error (the error would not occur if I did not call the function) but I cannot find the reason behind it. Is there any reference or example code I can refer to for solving this issue?

In the attach files is the source code in question (the function Flow_Based_Market_LP_Set is where things went wrong). The project it is located can be found at https://github.com/TonyYenTWN/trEnD/tree/main/src.

Attachments:
power_market_func.cpp [20.51 KiB]
Downloaded 623 times

Author:  Sergey.Bochkanov [ Sun Jul 17, 2022 11:22 am ]
Post subject:  Re: Solving multiple linear programming problems

Hi!

alglib::ap_error has msg parameter which contains a short description of what happened. Would you like to post it here?

Author:  tonyturtletwn [ Mon Jul 18, 2022 7:50 am ]
Post subject:  Re: Solving multiple linear programming problems

Sergey.Bochkanov wrote:
Hi!

alglib::ap_error has msg parameter which contains a short description of what happened. Would you like to post it here?


Hi,

Thanks for the advice. After using try/catch I found the error message was "MinLPSetBC: BndU contains NAN or -INF" and identified where I placed invalid boundary for the box constraints.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/