Skip to content

Commit 471d784

Browse files
committed
Merge branch 'latest' into pr-2555
2 parents ff250ac + 9591f8a commit 471d784

File tree

189 files changed

+16116
-2703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+16116
-2703
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
build --enable_platform_specific_config
2+
3+
build:windows --enable_runfiles
4+
15
build:asan --strip=never
26
build:asan --copt -fsanitize=address
37
build:asan --copt -O1

.github/workflows/build-fast.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Configure CMake
1919
shell: bash
2020
working-directory: ${{runner.workspace}}/build
21-
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE
21+
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_UNITY_BUILD=ON
2222

2323
- name: Build
2424
working-directory: ${{runner.workspace}}/build
@@ -45,7 +45,7 @@ jobs:
4545
- name: Configure CMake
4646
shell: bash
4747
working-directory: ${{runner.workspace}}/build
48-
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG
48+
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_UNITY_BUILD=ON
4949

5050
- name: Build
5151
working-directory: ${{runner.workspace}}/build

.github/workflows/build-wheels-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/checkout@v4
6060

6161
- name: Build wheels
62-
uses: pypa/cibuildwheel@v2.21
62+
uses: pypa/cibuildwheel@v3.0
6363
env:
6464
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
6565

.github/workflows/build-wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: build-wheels
22

3-
on: [push]
4-
# on: [pull_request]
3+
# on: [push]
4+
on: [pull_request]
55

66
concurrency:
77
group: ${{ github.workflow }}-${{ github.ref }}
@@ -47,6 +47,6 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@v4
4949
- name: Build wheels
50-
uses: pypa/cibuildwheel@v2.21
50+
uses: pypa/cibuildwheel@v3.0
5151
env:
5252
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

.github/workflows/valgrind.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,82 @@ jobs:
9292
--output-on-failure \
9393
2>&1 | tee logfile2
9494
95+
- name: Check log for Errors
96+
working-directory: ${{runner.workspace}}/build
97+
shell: bash
98+
run: |
99+
cat logfile2
100+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
101+
if grep -q "$OUTPUT" logfile2; then
102+
exit 0
103+
fi
104+
exit 1
105+
106+
examples:
107+
runs-on: ${{ matrix.os }}
108+
strategy:
109+
matrix:
110+
os: [ubuntu-latest]
111+
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- name: Install Valgrind
116+
run: sudo apt-get update && sudo apt-get install valgrind
117+
118+
- name: Create Build Environment
119+
run: cmake -E make_directory ${{runner.workspace}}/build
120+
121+
- name: Configure CMake All
122+
shell: bash
123+
working-directory: ${{runner.workspace}}/build
124+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug
125+
126+
- name: Build All
127+
working-directory: ${{runner.workspace}}/build
128+
shell: bash
129+
run: |
130+
cmake --build . --parallel
131+
132+
- name: Test cpp example
133+
working-directory: ${{runner.workspace}}/build
134+
shell: bash
135+
run: |
136+
valgrind \
137+
--leak-check=full \
138+
--show-leak-kinds=all \
139+
--track-origins=yes \
140+
-s \
141+
./bin/call_highs_from_cpp \
142+
--timeout 1000 \
143+
--output-on-failure \
144+
2>&1 | tee logfile2
145+
146+
- name: Check log for Errors
147+
working-directory: ${{runner.workspace}}/build
148+
shell: bash
149+
run: |
150+
cat logfile2
151+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
152+
if grep -q "$OUTPUT" logfile2; then
153+
exit 0
154+
fi
155+
exit 1
156+
157+
- name: Test C example
158+
working-directory: ${{runner.workspace}}/build
159+
shell: bash
160+
run: |
161+
valgrind \
162+
--leak-check=full \
163+
--show-leak-kinds=all \
164+
--track-origins=yes \
165+
-s \
166+
./bin/call_highs_from_c_minimal \
167+
--timeout 1000 \
168+
--output-on-failure \
169+
2>&1 | tee logfile2
170+
95171
- name: Check log for Errors
96172
working-directory: ${{runner.workspace}}/build
97173
shell: bash

BUILD.bazel

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
2-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")
2+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
33

44
copy_file(
55
name = "highs-config",
@@ -16,9 +16,8 @@ cc_library(
1616

1717
cc_library(
1818
name = "highs",
19-
srcs = glob([
19+
srcs = ["highs/interfaces/highs_c_api.cpp"] + glob([
2020
"extern/filereaderlp/*.cpp",
21-
"highs/interfaces/highs_c_api.cpp",
2221
"highs/io/*.cpp",
2322
"highs/ipm/*.cpp",
2423
"highs/ipm/ipx/*.cc",
@@ -35,18 +34,21 @@ cc_library(
3534
"highs/test_kkt/*.cpp",
3635
"highs/util/*.cpp",
3736
]),
38-
hdrs = glob([
39-
"**/*.h",
37+
hdrs = [
4038
"highs/mip/feasibilityjump.hh",
39+
] + glob([
40+
"**/*.h",
4141
"highs/qpsolver/*.hpp",
42-
"highs/Highs.h",
4342
"extern/filereaderlp/*.hpp",
4443
"extern/zstr/*.hpp",
4544
]),
46-
copts = [
47-
"-Wno-unused-variable",
48-
"-Wno-unused-but-set-variable",
49-
],
45+
copts = select({
46+
"@rules_cc//cc/compiler:msvc-cl": [],
47+
"//conditions:default": [
48+
"-Wno-unused-variable",
49+
"-Wno-unused-but-set-variable",
50+
],
51+
}),
5052
includes = [
5153
"extern",
5254
# "extern/filereaderlp",
@@ -66,7 +68,10 @@ cc_library(
6668
# "highs/util",
6769
"bazel-bin",
6870
],
69-
linkopts = ["-lpthread"],
71+
linkopts = select({
72+
"@rules_cc//cc/compiler:msvc-cl": ["-DEFAULTLIB:shell32.lib"],
73+
"//conditions:default": ["-lpthread"],
74+
}),
7075
visibility = ["//visibility:public"],
7176
deps = [
7277
"//:config",
@@ -76,8 +81,10 @@ cc_library(
7681

7782
cc_library(
7883
name = "highs-runtime-opts",
79-
hdrs = ["app/HighsRuntimeOptions.h",
80-
"app/CLI11.hpp"],
84+
hdrs = [
85+
"app/CLI11.hpp",
86+
"app/HighsRuntimeOptions.h",
87+
],
8188
visibility = ["//visibility:public"],
8289
deps = [
8390
"//:highs",
@@ -180,11 +187,13 @@ TEST_NAMES = [
180187
[cc_test(
181188
name = name,
182189
srcs = ["check/%s.cpp" % name],
183-
copts = [
184-
"-Iextern",
185-
"-Wno-unused-variable",
186-
"-Wno-unused-but-set-variable",
187-
],
190+
copts = ["-Iextern"] + select({
191+
"@rules_cc//cc/compiler:msvc-cl": [],
192+
"//conditions:default": [
193+
"-Wno-unused-variable",
194+
"-Wno-unused-but-set-variable",
195+
],
196+
}),
188197
deps = [
189198
":highs",
190199
":test_lib",

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ option(BUILD_CXX "Build C++ library" ON)
7373
message(STATUS "Build C++ library: ${BUILD_CXX}")
7474

7575
option(BUILD_CXX_EXE "Build C++ executable" ON)
76-
message(STATUS "Build C++ library: ${BUILD_CXX_EXE}")
76+
message(STATUS "Build C++ executable: ${BUILD_CXX_EXE}")
7777

7878
option(BUILD_TESTING "Build Tests" ON)
7979

@@ -500,7 +500,10 @@ if(ZLIB AND NOT TARGET ZLIB::ZLIB)
500500
find_package(ZLIB 1.2.3)
501501
endif()
502502

503-
include(CPack)
503+
if(CPack_CMake_INCLUDED EQUAL 0)
504+
include(CPack)
505+
endif()
506+
504507
set(CPACK_PACKAGE_VERSION_MAJOR "${HIGHS_VERSION_MAJOR}")
505508
set(CPACK_PACKAGE_VERSION_MINOR "${HIGHS_VERSION_MINOR}")
506509
set(CPACK_PACKAGE_VERSION_PATCH "${HIGHS_VERSION_PATCH}")

FEATURES.md

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,15 @@
11
## Build changes
22

3-
Replace command line parsing library with Cpp11 [#2211](https://github.com/ERGO-Code/HiGHS/pull/2211)
4-
5-
CMake updates [#2286](https://github.com/ERGO-Code/HiGHS/pull/2286), the root of the HiGHS source files is now `highs/`, rather than `src/`
6-
7-
Add missing include to zstr needed for gcc v15 and clang v19 [#2313](https://github.com/ERGO-Code/HiGHS/pull/2313)
8-
9-
Updates for intel llvm compiler on linux [#2257](https://github.com/ERGO-Code/HiGHS/pull/2257)
10-
11-
Build directory for Windows MSVC now `Release/bin` replacing `bin/Release` [#2376](https://github.com/ERGO-Code/HiGHS/pull/2376)
12-
133
## Code changes
144

15-
Fixed incorrect assertion in `HighsMipSolver::solutionFeasible()` (fixing [#2204](https://github.com/ERGO-Code/HiGHS/issues/2204))
16-
17-
As part of [#2251](https://github.com/ERGO-Code/HiGHS/issues/2251) cuPDLP-C will start from the incumbent solution in HiGHS. For a model that has been changed, the user must supply a starting solution via a call to `Highs::setSolution`
18-
19-
getColIntegrality now returns `HighsVarType::kContinuous` when `model_.lp_.integrality_` is empty (fixing [#2261](https://github.com/ERGO-Code/HiGHS/issues/2261))
20-
21-
Now ensuring that when solving a scaled LP with useful but unvalidated basis, it does not lose its scaling after validation, since the scaling factors will be applied to the solution (fixing [#2267](https://github.com/ERGO-Code/HiGHS/issues/2267))
22-
23-
By setting non-empty values of options `read_solution_file`, `read_basis_file`, `write_model_file` (with extension `.lp` or `.mps`), `write_solution_file`, `solution_file`, `write_basis_file`, these files will be read or written when calling `Highs::run()`. Hence options previously only available via the command line interface can be use (for example) by modelling languages that only call `Highs::run()` (fixing [#2269](https://github.com/ERGO-Code/HiGHS/issues/2269)).
24-
25-
Bug [#2273](https://github.com/ERGO-Code/HiGHS/issues/2273) fixed
26-
27-
Added the feasibility jump heuristic as per [#1423](https://github.com/ERGO-Code/HiGHS/issues/1423). This is on by default, but using the option `mip_heuristic_run_feasibility_jump=false` switches it off.
28-
29-
ZI rounding and shifting MIP primal heuristics have been added (see [#2287](https://github.com/ERGO-Code/HiGHS/pull/2287)). They are off by default, but can be activated by setting the options `mip_heuristic_run_zi_round` and `mip_heuristic_run_shifting` to be true. Options `mip_heuristic_run_rins`, `mip_heuristic_run_rens` and `mip_heuristic_run_root_reduced_cost` to run the RINS, RENS and rootReducedCost heuristics have been added. These are true by default, but setting them to be false can accelerate the MIP solver on easy problems.
30-
31-
Added `Highs_changeRowsBoundsByRange` to C API, fixing [#2296](https://github.com/ERGO-Code/HiGHS/issues/2296)
32-
33-
Corrected docstrings for `Highs_getReducedRow`, motivated by [#2312](https://github.com/ERGO-Code/HiGHS/issues/2312)
34-
35-
LP file reader no longer fails when there is no objective section. Fix is [#2316](https://github.com/ERGO-Code/HiGHS/pull/2316), but this exposes code quality issue [#2318](https://github.com/ERGO-Code/HiGHS/issues/2318)
36-
37-
Added a max scale factor (+1024) when scaling up coefficients in `preprocessBaseInequality` and `postprocessCut`. Fix is [#2337](https://github.com/ERGO-Code/HiGHS/pull/2337)
38-
39-
Corrected the bounds used in when strengthening coefficients in `HPresolve::rowPresolve`, fixing [#1517](https://github.com/ERGO-Code/HiGHS/issues/1517)
40-
41-
Fixed numerical error in `highs/mip/HighsCliqueTable.cpp`, closing [#2320](https://github.com/ERGO-Code/HiGHS/issues/2320)
42-
43-
Fixed bug in `highs/mip/HighsFeasibilityJump.cpp`, closing [#2331](https://github.com/ERGO-Code/HiGHS/issues/2331)
44-
45-
Tightened CMIR cuts, leading to small performance gain, closing [#2333](https://github.com/ERGO-Code/HiGHS/issues/2333)
46-
47-
Scaling the tolerance in forcing row reduction to avoid use of rows with small coefficients and bounds, closing [#2290](https://github.com/ERGO-Code/HiGHS/issues/2290)
48-
49-
Fixed bug when calculating a coefficient in one of the cuts in `separateImpliedBounds` in `highs/mip/HighsImplications.cpp`
50-
51-
Added `CSECTION` to the exceptions for keywords that are followed by text, and thus cannot be used as names of columns, RHS, ranges, bounds etc.
52-
53-
Introduced the following KKT error measures to `HighsInfo`: `num_relative_primal_infeasibilities`; `max_relative_primal_infeasibility`; `num_relative_dual_infeasibilities`; `max_relative_dual_infeasibility`; `num_primal_residual_errors`; `max_primal_residual_error`; `num_dual_residual_errors`; `max_dual_residual_error`; `num_relative_primal_residual_errors`; `max_relative_primal_residual_error`; `num_relative_dual_residual_errors`; `max_relative_dual_residual_error`; `num_complementarity_violations`; `max_complementarity_violation`; `primal_dual_objective_error.` The relative values are used to assess whether a solution deemed to be optimal by the first order LP solver `cuPDLP-C` or interior point solver `IPX` (without crossover) is truly acceptable. They also enable users to determine whether a solution corresponding to `HighsModelStatus::kUnknown` is acceptable to them as optimal. Also introduced options `complementarity_tolerance` used to assess whether the (relative) primal-dual objective error is acceptable, and `kkt_tolerance` which, if set to a value other than `kDefaultKktTolerance = 1e-7` is used as the tolerance for all the KKT error measures. The HiGHS documentation has been updated to reflect the new options and `HighsInfo` data, and logging messages indicate when KKT error measures are not satisfied, despite the solver considering the LP solution to be optimal.
5+
Forcing column reduction now checks the bound on the column dual rather than whether the dual row activity is zero fixing [#2409](https://github.com/ERGO-Code/HiGHS/issues/2409)
546

55-
Added a max scale factor (+1024) when scaling up coefficients in `preprocessBaseInequality` and `postprocessCut`. Fix is [#2337](https://github.com/ERGO-Code/HiGHS/pull/2337).
7+
Now handling correctly the case where an infeasible MIP has a feasible relaxation, so no ray is computed fixing [#2415](https://github.com/ERGO-Code/HiGHS/issues/2415)
568

57-
Renamed `HighsOptions::pdlp_d_gap_tol` to `HighsOptions::pdlp_optimality_tolerance` for consistency with IPM
9+
Fixed minor bug exposed by [#2441](https://github.com/ERGO-Code/HiGHS/issues/2441) in `Highs::setSolution()` for a sparse user solution when the moidel is empty, and only clearing the dual data before solving with modified objective in `Highs::multiobjectiveSolve()` so that user-supplied solution is not cleared.
5810

59-
Renamed `HighsOptions::complementarity_tolerance` to `HighsOptions::optimality_tolerance` for consistency with IPM and PDLP
11+
The irreducible infeasibility system (IIS) facility now detects infeasibility due to bounds on constraint activity values (implied by variable bounds) being incompatible with constraint bounds. A `kIisStrategyLight mode` for the `iis_strategy` option has been introduced so that only infeasibility due to incompatible variable/constraint bounds and constraint activity values is checked for. The LP corresponding to any known IIS is now formed and held as a data member of the `HighsIis` class. It can be obtained as a const reference using `Highs::getIisLp()`, and written to a file using `Highs::writeIisModel(const std::string& filename = "")`
6012

13+
Prompted by [#2463](https://github.com/ERGO-Code/HiGHS/issues/2463), the HiGHS solution and basis files now match data to any column and row names in the model, only assuming that the data are aligned with column and row indices if there are no names in the model. This requires a new version (v2) of the HiGHS basis file. Basis files from v1 are still read, but deprecated. Now, when writing out a model, basis or solution, column and row names are added to the model - previously they were created temporarily and inconsistentyly on the fly. If the model has existing names, then distinctive names are created to replace any blank names, but names with spaces or duplicate names yield an error status return.
6114

15+
As per [#2487](https://github.com/ERGO-Code/HiGHS/issues/2487), trivial heuristics now run before feasibility jump (FJ), and FJ will use any existing incumbent. FJ will clip any finite variable values in the incumbent to lower and upper bounds, and falls back to the existing logic (lower bound if finite, else upper bound if finite, else 0) for any infinite values in the incumbent.

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module(
77

88
bazel_dep(
99
name = "bazel_skylib",
10-
version = "1.7.1",
10+
version = "1.8.1",
1111
)
1212

1313
bazel_dep(
1414
name = "rules_cc",
15-
version = "0.0.16",
15+
version = "0.1.2",
1616
)
1717

1818
bazel_dep(
1919
name = "zlib",
20-
version = "1.3.1.bcr.3",
20+
version = "1.3.1.bcr.5",
2121
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ linear optimization problems of the form
4646

4747
$$ \min \quad \dfrac{1}{2}x^TQx + c^Tx \qquad \textrm{s.t.}~ \quad L \leq Ax \leq U; \quad l \leq x \leq u $$
4848

49-
where Q must be positive semi-definite and, if Q is zero, there may be a requirement that some of the variables take integer values. Thus HiGHS can solve linear programming (LP) problems, convex quadratic programming (QP) problems, and mixed integer programming (MIP) problems. It is mainly written in C++, but also has some C. It has been developed and tested on various Linux, MacOS and Windows installations. No third-party dependencies are required.
49+
where $Q$ must be positive semi-definite and, if $Q$ is zero, there may be a requirement that some of the variables take integer values. Thus HiGHS can solve linear programming (LP) problems, convex quadratic programming (QP) problems, and mixed integer programming (MIP) problems. It is mainly written in C++, but also has some C. It has been developed and tested on various Linux, MacOS and Windows installations. No third-party dependencies are required.
5050

5151
HiGHS has primal and dual revised simplex solvers, originally written by Qi Huangfu and further developed by Julian Hall. It also has an interior point solver for LP written by Lukas Schork, an active set solver for QP written by Michael Feldmeier, and a MIP solver written by Leona Gottwald. Other features have been added by Julian Hall and Ivet Galabova, who manages the software engineering of HiGHS and interfaces to C, C#, FORTRAN, Julia and Python.
5252

0 commit comments

Comments
 (0)