2

I'm using COIN-OR Cbc via its cbc command line tool and need to abort some computations if they take too long.

I'm aware that I could write a controlling process around cbc to kill it after the timeout expires. I'm also aware that I could use cbc as C++ library. Both seem so be quite cumbersome, I'm looking for a simpler, direct solution.

Is this possible directly via the cbc command line tool?

If not, is there a simple way using cbc as C++ library? (read an *.lp file, apply timeout, create *.soln file)

vog
  • 23,517
  • 11
  • 59
  • 75
  • I thought it would be clear from or "coin-or-cbc" tag. I adjusted the question to make clear which CBC tool / library I mean – vog Aug 12 '18 at 18:11

1 Answers1

3

Yes. Use the -sec command-line option. The full command line would be:

cbc -sec 10 -import inputfile.lp -solve

This is equivalent to running an interactive session by typing only cbc on the command line, then entering the following commands:

sec 10
import inputfile.lp
solve
James Trimble
  • 1,868
  • 13
  • 20