MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / openNodesToQueue

Method openNodesToQueue

highs/mip/HighsSearch.cpp:746–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744}
745
746void HighsSearch::openNodesToQueue(HighsNodeQueue& nodequeue) {
747 if (nodestack.empty()) return;
748
749 // get the basis of the node highest up in the tree
750 std::shared_ptr<const HighsBasis> basis;
751 for (NodeData& nodeData : nodestack) {
752 if (nodeData.nodeBasis) {
753 basis = std::move(nodeData.nodeBasis);
754 break;
755 }
756 }
757
758 if (nodestack.back().opensubtrees == 0) backtrack(false);
759
760 while (!nodestack.empty()) {
761 auto oldchangedcols = localdom.getChangedCols().size();
762 bool prune = nodestack.back().lower_bound > getCutoffBound();
763 if (!prune) {
764 localdom.propagate();
765 localdom.clearChangedCols(oldchangedcols);
766 prune = localdom.infeasible();
767 if (prune)
768 localdom.conflictAnalysis(getConflictPool(),
769 mipworker.getGlobalDomain(), pseudocost);
770 }
771 if (!prune) {
772 std::vector<HighsInt> branchPositions;
773 auto domchgStack = localdom.getReducedDomainChangeStack(branchPositions);
774 double tmpTreeWeight = nodequeue.emplaceNode(
775 std::move(domchgStack), std::move(branchPositions),
776 std::max(nodestack.back().lower_bound,
777 localdom.getObjectiveLowerBound()),
778 nodestack.back().estimate, getCurrentDepth());
779 if (countTreeWeight) treeweight += tmpTreeWeight;
780 } else {
781 mipsolver.mipdata_->debugSolution.nodePruned(localdom);
782 if (countTreeWeight) treeweight += std::ldexp(1.0, 1 - getCurrentDepth());
783 }
784 nodestack.back().opensubtrees = 0;
785 backtrack(false);
786 }
787
788 lp->flushDomain(localdom);
789 if (basis) {
790 if ((HighsInt)basis->row_status.size() == lp->numRows())
791 lp->setStoredBasis(std::move(basis));
792 lp->recoverBasis();
793 }
794}
795
796void HighsSearch::flushStatistics(HighsMipSolver& mipsolver) {
797 mipsolver.mipdata_->num_nodes += nnodes;

Callers 1

runMethod · 0.80

Calls 14

propagateMethod · 0.80
clearChangedColsMethod · 0.80
infeasibleMethod · 0.80
conflictAnalysisMethod · 0.80
emplaceNodeMethod · 0.80
flushDomainMethod · 0.80
setStoredBasisMethod · 0.80
recoverBasisMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected