Skip to content

Commit 806a56a

Browse files
authored
Merge pull request #1497 from guifcoelho/fix/branch_and_price_prune_node_when_rmp_is_feasible
Issue 1496
2 parents 58e8254 + 913fe6d commit 806a56a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

examples/branch-and-price.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,9 @@ def branchAndPrice(m, vals, columns, start_time=0):
366366
mp_is_feasible, m, node = solveNode(node, columns, m)
367367
count_nodes_visited += 1
368368

369-
# Prune nodes that cannot lead to optimal solution
370-
if node.value >= best_obj:
371-
continue
372-
373369
# Only add columns if the master problem is feasible
374-
if mp_is_feasible:
370+
# Prune nodes that cannot lead to optimal solution
371+
if mp_is_feasible and node.value < best_obj:
375372
columns = node.final_columns
376373
count_fractional_columns = len(node.final_fractional_columns)
377374

0 commit comments

Comments
 (0)