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

Method checkLocalLimits

highs/mip/HighsSearch.cpp:1949–1982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1947}
1948
1949bool HighsSearch::checkLocalLimits() const {
1950 if (mipsolver.mipdata_->terminatorActive())
1951 if (mipsolver.mipdata_->terminatorTerminated()) return true;
1952
1953 if (!mipsolver.submip && mipworker.upper_bound < kHighsInf &&
1954 mipsolver.options_mip_->objective_target > -kHighsInf) {
1955 const double internal_target =
1956 static_cast<HighsInt>(mipsolver.orig_model_->sense_) *
1957 mipsolver.options_mip_->objective_target -
1958 mipsolver.model_->offset_;
1959 if (mipworker.upper_bound < internal_target) {
1960 return true;
1961 }
1962 }
1963
1964 if (mipsolver.options_mip_->mip_max_nodes != kHighsIInf &&
1965 mipsolver.mipdata_->num_nodes + nnodes >=
1966 mipsolver.options_mip_->mip_max_nodes) {
1967 return true;
1968 }
1969
1970 if (mipsolver.options_mip_->mip_max_leaves != kHighsIInf &&
1971 mipsolver.mipdata_->num_leaves + nleaves >=
1972 mipsolver.options_mip_->mip_max_leaves) {
1973 return true;
1974 }
1975
1976 if (mipsolver.options_mip_->time_limit < kHighsInf &&
1977 mipsolver.timer_.read() >= mipsolver.options_mip_->time_limit) {
1978 return true;
1979 }
1980
1981 return false;
1982}
1983
1984HighsSymmetries& HighsSearch::getSymmetries() const {
1985 return mipsolver.mipdata_->symmetries;

Callers 1

runMethod · 0.80

Calls 3

terminatorActiveMethod · 0.80
terminatorTerminatedMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected