Fix lost nodes in branch and bound - #1138
Conversation
📝 WalkthroughWalkthroughThe branch-and-bound solver's ChangesPending node requeuing on early termination
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/src/branch_and_bound/branch_and_bound.cpp (1)
1485-1492: Optional cleanup: merge identical limit branches.Both status branches perform the same operations; collapsing them reduces maintenance drift.
♻️ Proposed simplification
- } else if (lp_status == dual::status_t::CONCURRENT_LIMIT) { - stack.push_front(node_ptr); - requeue_pending_nodes = true; - break; - } else if (lp_status == dual::status_t::ITERATION_LIMIT) { + } else if (lp_status == dual::status_t::CONCURRENT_LIMIT || + lp_status == dual::status_t::ITERATION_LIMIT) { stack.push_front(node_ptr); requeue_pending_nodes = true; break; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cpp/src/branch_and_bound/branch_and_bound.cpp` around lines 1485 - 1492, The two consecutive branches checking lp_status == dual::status_t::CONCURRENT_LIMIT and lp_status == dual::status_t::ITERATION_LIMIT perform identical actions; collapse them into a single condition to avoid duplication. Replace the two else-if blocks with a single branch that checks if lp_status is either dual::status_t::CONCURRENT_LIMIT or dual::status_t::ITERATION_LIMIT, then call stack.push_front(node_ptr), set requeue_pending_nodes = true, and break; referencing the existing lp_status variable and the stack.push_front(node_ptr)/requeue_pending_nodes/break sequence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cpp/src/branch_and_bound/branch_and_bound.cpp`:
- Around line 1485-1492: The two consecutive branches checking lp_status ==
dual::status_t::CONCURRENT_LIMIT and lp_status ==
dual::status_t::ITERATION_LIMIT perform identical actions; collapse them into a
single condition to avoid duplication. Replace the two else-if blocks with a
single branch that checks if lp_status is either
dual::status_t::CONCURRENT_LIMIT or dual::status_t::ITERATION_LIMIT, then call
stack.push_front(node_ptr), set requeue_pending_nodes = true, and break;
referencing the existing lp_status variable and the
stack.push_front(node_ptr)/requeue_pending_nodes/break sequence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a1bddad0-abbf-4409-901c-017c5fabffd6
📒 Files selected for processing (3)
cpp/src/branch_and_bound/branch_and_bound.cppcpp/src/mip_heuristics/diversity/lns/rins.cucpp/src/mip_heuristics/diversity/lns/rins.cuh
nguidotti
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the fix, Hugo.
|
🔔 Hi @anandhkb, this pull request has had no activity for 7 days. Please update or let us know if it can be closed. Thank you! If this is an "epic" issue, then please add the "epic" label to this issue. |
1 similar comment
|
🔔 Hi @anandhkb, this pull request has had no activity for 7 days. Please update or let us know if it can be closed. Thank you! If this is an "epic" issue, then please add the "epic" label to this issue. |
|
/merge |
Fix lost branch-and-bound nodes when a plunge exits early due to LP solve limits.
CONCURRENT_LIMIT.ITERATION_LIMIT.plunge_withexits early, so the solver does not silently drop unexplored nodes or computean incorrect lower bound.