1

I 'm trying to resolve a problem using the CVXPY and I need to set up a time limit. How can I do it ?

I tried so set an argument like time_limit or maximumseconds and I didn't get no result. I read the Documentation but I didn't find none about this.

  • Welcome to Stack Overflow! In order for us to help you better, please follow this [link](https://stackoverflow.com/help/mcve) and edit your question. – m13op22 Apr 24 '19 at 19:10

2 Answers2

3

The CVXPY documentation here (scroll down to where it says "CPLEX options") explains how to set CPLEX parameters in CVXPY. For example, to set the time limit parameter to 60 seconds, you would do the following:

prob.solve(solver=cvxpy.CPLEX, verbose=True, cplex_params={"timelimit": 60})
rkersh
  • 4,447
  • 2
  • 22
  • 31
1

Have you tried this:

prob.solve(solver=cvxpy.CPLEX, cplex_params={"timelimit": 20}) 
Anthony
  • 3,595
  • 2
  • 29
  • 38
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15