Skip to content

Commit f69a699

Browse files
committed
Merge branch 'latest' into fix-3046
2 parents 3b95140 + 80899d0 commit f69a699

115 files changed

Lines changed: 3198 additions & 1059 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Report unexpected behaviour or a crash
4+
---
5+
6+
Please provide the following information where possible/relevant and check out [CONTRIBUTING.md](https://github.com/ERGO-Code/HiGHS/blob/master/CONTRIBUTING.md).
7+
8+
**What version of HiGHS and what language are you using?**
9+
Version: master/latest/v1.15.0/v1.14.0 etc.
10+
Language: C++/C/Python/C#/Fortran/Julia/Rust
11+
12+
**Which solver are you using (e.g. LP, MIP, QP)**
13+
14+
**What operating system (Linux, Windows, ...) and version?**
15+
16+
**What did you do?**
17+
Steps to reproduce the behaviour:
18+
19+
**What did you expect to see**
20+
21+
**What did you see instead?**
22+
23+
Make sure you include information that can help us debug (full error message, model if possible).
24+
25+
**Anything else we should know about your project / environment**

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Modelling / Usage problem
4+
url: https://github.com/ERGO-Code/HiGHS/discussions
5+
about: Need help modelling or using HiGHS? Please use Discussions rather than opening an issue.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
---
5+
6+
Please provide the following information where possible/relevant.
7+
8+
**What language and solver does this apply to?**
9+
All, C++, C, Python, C#, Fortran / LP, MIP, QP
10+
11+
**Describe the problem you are trying to solve.**
12+
13+
**Describe the solution you'd like**
14+
15+
**Describe alternatives you've considered**
16+
17+
**Additional context**
18+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Thank you for contributing to HiGHS!
3+
4+
Please make sure this PR targets the `latest` branch, not `master`.
5+
-->
6+
7+
## Description
8+
9+
<!-- What does this PR change, and why? -->
10+
11+
## Checklist
12+
13+
- [ ] I have read the [contributing guidelines](https://github.com/ERGO-Code/HiGHS/blob/latest/CONTRIBUTING.md)
14+
- [ ] This PR targets the `latest` branch
15+
- [ ] Tests are passing
16+
- [ ] Documentation was updated where relevant
17+
- [ ] This PR is not primarily AI-generated (per the AI contributions policy in CONTRIBUTING.md)
18+
19+
<!-- Please uncomment if the PR closes a related issue. -->
20+
<!--
21+
## Related issue
22+
Closes #
23+
-->

.github/workflows/action-sanitizers-bazel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
run: bazel test -c dbg --config=tsan --runs_per_test 5 //...
5959

6060
- name: Upload bazel-testlogs
61+
if: failure()
6162
uses: actions/upload-artifact@v7
6263
with:
6364
name: bazel-testlogs-tsan

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ Welcome! This document explains some of the ways you can contribute to HiGHS.
66

77
This project and everyone participating in it is governed by the [HiGHS Code of Conduct](https://github.com/ERGO-Code/HiGHS/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
88

9-
## Contact the HiGHS team
9+
## Contribute code to HiGHS
1010

11-
Contact [Julian](https://github.com/jajhall) (General issues and solvers), [Ivet](https://github.com/galabovaa) (Build and interfaces)
11+
HiGHS is open source for distribution rather than contribution. This applies particularly to the core C++ code of the solvers. However, there is definitely scope for external contribution to interfaces and documentation. If you want to contribute in this way, please open an issue before making a pull request, since pull requests to the HiGHS solvers will not normally be accepted.
1212

13-
## Improve the documentation
13+
Please note that any pull requests to HiGHS must be made to the `latest` branch, so that full testing can take place befor updating `master`. This ensures that `master` is always good to be downloaded by users. As a consequence, any changes should be developed as a branch of `latest` to reduce the chance of merge conflicts.
1414

15-
The top level [documentation](https://ergo-code.github.io/HiGHS/) is created using [Documenter](https://documenter.juliadocs.org/stable/), with the files held on the [HiGHS repository](https://github.com/ERGO-Code/HiGHS/tree/master/docs). If your change is small (like fixing typos, or one or two sentence corrections), the easiest way to do this is to fork the branch and create a pull request. (See *Contribute code to HiGHS* below for more on this.) If your change is larger, or touches multiple files, please raise an issue describing what you want to do.
15+
Note that, under the terms of the MIT license, by contributing to HiGHS you assign away your rights to the content of your contribution.
1616

17-
## Raise an issue
17+
## AI generated contributions ##
1818

19-
You can raise an [issue](https://github.com/ERGO-Code/HiGHS/issues) with HiGHS in the normal way via [GitHub](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue).
19+
Whilst AI may be valuable for generating and communicating suggestions for code and build system developments, the review of AI-generated pull requests (other than the most trivial) would require resources that we don't have, so will not be accepted. If the suggestions are good, they will be implemented by HiGHS developers without the use of AI.
2020

21-
## Contribute code to HiGHS
21+
## Contact the HiGHS team
2222

23-
HiGHS is open source for distribution rather than contribution. This applies particularly to the core C++ code of the solvers. However, there is definitely scope for external contribution to interfaces and documentation. If you want to contribute in this way, please open an issue before making a pull request, since pull requests to the HiGHS solvers will not normally be accepted.
23+
Contact [Julian](https://github.com/jajhall) (General issues and solvers), [Ivet](https://github.com/galabovaa) (Build and interfaces).
2424

25-
Please note that any pull requests to HiGHS must be made to the `latest` branch, so that full testing can take place befor updating `master`. This ensures that `master` is always good to be downloaded by users. As a consequence, any changes should be developed as a branch of `latest` to reduce the chance of merge conflicts.
25+
## Improve the documentation
2626

27-
Note that, under the terms of the MIT license, by contributing to HiGHS you assign away your rights to the content of your contribution.
27+
The top level [documentation](https://ergo-code.github.io/HiGHS/) is created using [Documenter](https://documenter.juliadocs.org/stable/), with the files held on the [HiGHS repository](https://github.com/ERGO-Code/HiGHS/tree/master/docs). If your change is small (like fixing typos, or one or two sentence corrections), the easiest way to do this is to fork the branch and create a pull request. (See *Contribute code to HiGHS* for more on this.) If your change is larger, or touches multiple files, please raise an issue describing what you want to do.
2828

29-
## AI generated contributions ##
29+
## Raise an issue
3030

31-
Whilst AI may be valuable for generating and communicating suggestions for code and build system developments, the review of AI-generated pull requests (other than the most trivial) would require resources that we don't have, so will not be accepted. If the suggestions are good, they will be implemented by HiGHS developers without the use of AI.
31+
You can raise an [issue](https://github.com/ERGO-Code/HiGHS/issues) with HiGHS in the normal way via [GitHub](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue).

check/Avgas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <vector>
1717

18-
#include "util/HighsInt.h"
18+
#include "util/HighsType.h"
1919

2020
const HighsInt avgas_num_col = 8;
2121
const HighsInt avgas_num_row = 10;

check/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
8181
TestSetup.cpp
8282
TestSort.cpp
8383
TestSpecialLps.cpp
84+
TestSymmetry.cpp
8485
TestThrow.cpp
8586
TestTspSolver.cpp
8687
TestUserScale.cpp

check/TestCheckSolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
289289

290290
index.clear();
291291
value.clear();
292-
std::vector<bool> is_set;
292+
std::vector<HighsBool> is_set;
293293
is_set.assign(lp.num_col_, false);
294294
HighsInt num_to_set = 2;
295295
assert(num_to_set > 0);

check/TestMipSolver.cpp

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "Highs.h"
33
#include "SpecialLps.h"
44
#include "catch.hpp"
5+
#include "mip/HighsCliqueTable.h"
6+
#include "mip/HighsMipSolver.h"
7+
#include "mip/HighsMipSolverData.h"
58

69
const bool dev_run = false;
710
const double double_equal_tolerance = 1e-5;
@@ -1605,3 +1608,99 @@ TEST_CASE("issue-3118a", "[highs_test_mip_solver]") {
16051608

16061609
highs.resetGlobalScheduler(true);
16071610
}
1611+
1612+
TEST_CASE("MIP-equality-clique-fixing", "[highs_test_mip_solver]") {
1613+
// Regression test: when an equality clique has all but one variable fixed,
1614+
// the last active variable must be fixed before the clique is removed.
1615+
const HighsInt ncols = 5;
1616+
HighsLp lp;
1617+
lp.num_col_ = ncols;
1618+
lp.num_row_ = 0;
1619+
lp.col_cost_.assign(ncols, 0.0);
1620+
lp.col_lower_.assign(ncols, 0.0);
1621+
lp.col_upper_.assign(ncols, 1.0);
1622+
lp.integrality_.assign(ncols, HighsVarType::kInteger);
1623+
lp.a_matrix_.start_.assign(ncols + 1, 0);
1624+
1625+
Highs highs;
1626+
highs.setOptionValue("output_flag", dev_run);
1627+
highs.passModel(lp);
1628+
1629+
HighsCallback callback(&highs);
1630+
const HighsOptions& options = highs.getOptions();
1631+
HighsSolution solution;
1632+
HighsMipSolver mipsolver(callback, options, lp, solution);
1633+
mipsolver.mipdata_ =
1634+
std::unique_ptr<HighsMipSolverData>(new HighsMipSolverData(mipsolver));
1635+
mipsolver.mipdata_->feastol = 1e-6;
1636+
mipsolver.mipdata_->setupDomainPropagation();
1637+
1638+
HighsCliqueTable& cliquetable = mipsolver.mipdata_->cliquetable;
1639+
HighsDomain& domain = mipsolver.mipdata_->getDomain();
1640+
1641+
// Add equality clique: x0 + x1 + x2 + x3 + x4 = 1
1642+
HighsCliqueTable::CliqueVar clique[] = {
1643+
{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}};
1644+
cliquetable.doAddClique(clique, 5, true);
1645+
cliquetable.setPresolveFlag(true);
1646+
1647+
// Fix x0..x3 = 0 via vertexInfeasible (simulates what cleanupFixed does)
1648+
for (HighsInt i = 0; i < 4; i++) {
1649+
domain.fixCol(i, 0.0);
1650+
cliquetable.vertexInfeasible(domain, i, 1);
1651+
}
1652+
1653+
// The last variable x4 must now be fixed to 1
1654+
REQUIRE(domain.isFixed(4));
1655+
REQUIRE(domain.col_lower_[4] == 1.0);
1656+
1657+
highs.resetGlobalScheduler(true);
1658+
}
1659+
1660+
TEST_CASE("MIP-equality-clique-fixing-to-zero", "[highs_test_mip_solver]") {
1661+
// Same as above but with val=0 clique entries: the active value is 0.
1662+
// Fixing all but one variable to 1 (inactive) should fix the last to 0.
1663+
const HighsInt ncols = 5;
1664+
HighsLp lp;
1665+
lp.num_col_ = ncols;
1666+
lp.num_row_ = 0;
1667+
lp.col_cost_.assign(ncols, 0.0);
1668+
lp.col_lower_.assign(ncols, 0.0);
1669+
lp.col_upper_.assign(ncols, 1.0);
1670+
lp.integrality_.assign(ncols, HighsVarType::kInteger);
1671+
lp.a_matrix_.start_.assign(ncols + 1, 0);
1672+
1673+
Highs highs;
1674+
highs.setOptionValue("output_flag", dev_run);
1675+
highs.passModel(lp);
1676+
1677+
HighsCallback callback(&highs);
1678+
const HighsOptions& options = highs.getOptions();
1679+
HighsSolution solution;
1680+
HighsMipSolver mipsolver(callback, options, lp, solution);
1681+
mipsolver.mipdata_ =
1682+
std::unique_ptr<HighsMipSolverData>(new HighsMipSolverData(mipsolver));
1683+
mipsolver.mipdata_->feastol = 1e-6;
1684+
mipsolver.mipdata_->setupDomainPropagation();
1685+
1686+
HighsCliqueTable& cliquetable = mipsolver.mipdata_->cliquetable;
1687+
HighsDomain& domain = mipsolver.mipdata_->getDomain();
1688+
1689+
// Add equality clique with val=0: (1-x0) + (1-x1) + ... + (1-x4) = 1
1690+
HighsCliqueTable::CliqueVar clique[] = {
1691+
{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}};
1692+
cliquetable.doAddClique(clique, 5, true);
1693+
cliquetable.setPresolveFlag(true);
1694+
1695+
// Fix x0..x3 = 1 via vertexInfeasible (makes their val=0 entry infeasible)
1696+
for (HighsInt i = 0; i < 4; i++) {
1697+
domain.fixCol(i, 1.0);
1698+
cliquetable.vertexInfeasible(domain, i, 0);
1699+
}
1700+
1701+
// The last variable x4 must now be fixed to 0
1702+
REQUIRE(domain.isFixed(4));
1703+
REQUIRE(domain.col_upper_[4] == 0.0);
1704+
1705+
highs.resetGlobalScheduler(true);
1706+
}

0 commit comments

Comments
 (0)