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

solve_problem_by_Cplex.py #2

Open
zhangshuaiqing opened this issue Jun 29, 2023 · 8 comments
Open

solve_problem_by_Cplex.py #2

zhangshuaiqing opened this issue Jun 29, 2023 · 8 comments

Comments

@zhangshuaiqing
Copy link

if name == "main":
solve_problem_by_Cplex ('../res/problem.lp')
I can't find problem.lp under the res folder.

@ofanan
Copy link
Owner

ofanan commented Jun 29, 2023 via email

@zhangshuaiqing
Copy link
Author

Thank you for your reply, and I have another problem when running toy_example.py such as
ModuleNotFoundError: No module named 'Check_sol' and
ModuleNotFoundError: No module named 'obj_func'
and I check that there no file Check_sol and obj_func under src folder.

@ofanan
Copy link
Owner

ofanan commented Jun 29, 2023 via email

@zhangshuaiqing
Copy link
Author

zhangshuaiqing commented Jun 29, 2023

Hi,
The program is not running properly. and I find that there no Check_sol under src folder.

@zhangshuaiqing
Copy link
Author

Hi, Fixed. Please pull the updated solve_problem_by_Cplex.py, and the /res/lp directory. However, please note that this is a rather old version - the newer versions now use Gurobi. Hence I can't guarantee it really works. Good luck,

On Thu, Jun 29, 2023 at 6:11 PM zhangshuaiqing @.> wrote: if name == "main": solve_problem_by_Cplex ('../res/problem.lp') I can't find problem.lp under the res folder. — Reply to this email directly, view it on GitHub <#2>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGUOGZHHGXYFIKKHGAABRTXNWLJBANCNFSM6AAAAAAZYU76RE . You are receiving this because you are subscribed to this thread.Message ID: @.>
-- Itamar Cohen, www.ofanan.com *“The only thing necessary for the triumph of evil is for good men to do nothing” (*Edmund Burke)

When I tried again, I meet this problem.
CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016.
Traceback (most recent call last):
File ".\solve_problem_by_Cplex.py", line 44, in
solve_problem_by_Cplex ('../res/lp/problem.lp')
problem.solve () #TimeLimit=1000?
File "D:\python\anaconda3\envs\sumo\lib\site-packages\cplex_init_.py", line 1312, in solve
_proc.lpopt(self._env._e, self._lp)
File "D:\python\anaconda3\envs\sumo\lib\site-packages\cplex_internal_procedural.py", line 738, in lpopt
check_status(env, status)
File "D:\python\anaconda3\envs\sumo\lib\site-packages\cplex_internal_procedural.py", line 249, in call
raise CplexSolverError(error_string, env, status)
cplex.exceptions.errors.CplexSolverError: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016.

but when the input file is shoter.lp, the program runs correctly and returns,
Version identifier: 22.1.0.0 | 2022-03-25 | 54982fbec
CPXPARAM_Read_DataCheck 1
Tried aggregator 1 time.
LP Presolve eliminated 2 rows and 3 columns.
All rows and columns eliminated.
Presolve time = 0.00 sec. (0.00 ticks)


Sol status: optimal


lp sol cost = 4.00

I learn from the Internet that the academic version of cplex only supports solving problems with 1000 variables, and the number of variables required to be solved in problem.lp is 6410. Is this the cause of the program error?

@ofanan
Copy link
Owner

ofanan commented Jun 29, 2023 via email

@zhangshuaiqing
Copy link
Author

Hi, You may find them here https://github.com/ofanan/SFC_migration/tree/d20c481ff2d08287708afa6b16e4abd1c86072b1/src . Please inform me whether they run properly. If so, I'll push them again into the main update repo. Best wishes,

On Thu, Jun 29, 2023 at 7:52 PM zhangshuaiqing @.> wrote: Thank you for your reply, and I have another problem when running toy_example.py such as ModuleNotFoundError: No module named 'Check_sol' and ModuleNotFoundError: No module named 'obj_func' and I check that there no file Check_sol and obj_func under src folder. — Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGUOG7S2RSULUT6ZC24FADXNWXGVANCNFSM6AAAAAAZYU76RE . You are receiving this because you commented.Message ID: @.>
-- Itamar Cohen, www.ofanan.com *“The only thing necessary for the triumph of evil is for good men to do nothing” (*Edmund Burke)

Hi,
I find obj_func but no Check_sol under https://github.com/ofanan/SFC_migration/tree/d20c481ff2d08287708afa6b16e4abd1c86072b1/src.
Please push them again into the main update repo., thanks.

@ofanan
Copy link
Owner

ofanan commented Jul 1, 2023 via email

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

2 participants