Skip to content

Commit 858304d

Browse files
authored
added maxNodes option for CBC (#690)
1 parent 787973b commit 858304d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pulp/apis/coin_api.py

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(
6363
logPath=None,
6464
timeMode="elapsed",
6565
mip_start=False,
66+
maxNodes=None,
6667
):
6768
"""
6869
:param bool mip: if False, assume LP even if integer variables
@@ -83,6 +84,7 @@ def __init__(
8384
:param float maxSeconds: deprecated for timeLimit
8485
:param str timeMode: "elapsed": count wall-time to timeLimit; "cpu": count cpu-time
8586
:param bool mip_start: deprecated for warmStart
87+
:param int maxNodes: max number of nodes during branching. Stops the solving when reached.
8688
"""
8789

8890
if fracGap is not None:
@@ -124,6 +126,7 @@ def __init__(
124126
gapAbs=gapAbs,
125127
logPath=logPath,
126128
timeMode=timeMode,
129+
maxNodes=maxNodes,
127130
)
128131

129132
def copy(self):
@@ -236,6 +239,7 @@ def getOptions(self):
236239
strong="strong {}",
237240
cuts="gomory on knapsack on probing on",
238241
timeMode="timeMode {}",
242+
maxNodes="maxNodes {}",
239243
)
240244

241245
return [

0 commit comments

Comments
 (0)