Package: exact
ExactExactsolves decision and optimization problems formulated as integer linear programs. Under the hood, it converts integer variables to binary (0-1) variables and applies highly efficient propagation routines and strong cutting-planes / pseudo-Boolean conflict analysis.Exact is a fork ofRoundingSatand improves upon its predecessor in reliability, performance and ease-of-use.
The name "Exact" reflects that the answers are fully sound, as approximate and floating-point calculations only occur in heuristic parts of the algorithm.
As such, Exact can soundly be used for verification and theorem proving, where its envisioned ability to emit machine-checkable certificates of optimality and unsatisfiability should prove useful.Stay updatedFollow@ExactSolveron Twitter and join thereddit community.FeaturesNative conflict analysisover binary linear constraints, constructing full-blown cutting planes proofs.Highly efficientwatched propagationroutines.Seamless use ofarbitrary precisionarithmetic when needed.Hybrid linear (top-down) andcore-guided(bottom-up) optimization.Optional integration with theSoPlex LP solver.Core solver also compiles onmacOSandWindows.Under development:Pythoninterface with assumption solving and reuse of solver state (Linux only for now).Under development: generation ofcertificatesof optimality and unsatisfiability that can be automatically verified byVeriPB.Python interfacePyPi packageThe easiest way is to use anx86_64machine withLinuxoperating system. In that case, install this precompiledPyPi package, e.g., by runningpip3 install exact.Compile your own Python packageTo use the Exact Python interface with optimal binaries for your machine (and the option to include SoPlex in the binary), compile as a shared library and install it with your package manager (e.g.,pip).On Linux,this scriptshould do the trick.
On other systems, something similar should work.
Make sure to have the Boost libraries installed (see dependencies).DocumentationThe header fileExact.hppcontains the C++ methods exposed to Python viacppyyas well as their description. This is probably the place to start to learn about Exact's Python usage.Next,python/examplescontains instructive, fully commented examples.python/examples/knapsack_classic.pyshowcases how to solve an integer classic knapsack problem with Exact's Python interface.python/examples/knapsack_implied.pyelaborates on the first and showcases how to find the variable assignments implied by optimality, i.e., the variable assignments shared by all optimal solutions. A combination of the mechanics of assumption and solution invalidation allow to reuse the existing solver state (containing learned constraints) for optimal performance.python/examples/knapsack_propagate.pyelaborates on the second and showcases the builtin propagate method, which returns implied variable bounds under given assumptions.python/examples/ramsey.pytries to compute the infamousRamsey numbers.python/examples/graph_coloring/graph_coloring.pytries to find the chromatic number of a graph. If you can get Exact to prove the provided graph cannot be colored with 6 colors, contact @JoD ;)Command line usageExact takes as input an integer linear program and outputs a(n optimal) solution or reports that none exists.
Either pipe the programcat test/instances/opb/opt/stein15.opb | build/Exactor pass the file as a parameterbuild/Exact test/instances/opb/opt/stein15.opbUse the flag--helpto display a list of runtime parameters.Exact supports five input formats (described in more detail inInputFormats.md):.opbpseudo-Boolean PBO (only linear objective and constraints).cnfDIMACS Conjunctive Normal Form (CNF).wcnfWeighted Conjunctive Normal Form (WCNF).mpsMathematical Programming System (MPS) via the optional CoinUtils library.lpLinear Program (LP) via the optional CoinUtils libraryNote that.mpsand.lpallow rational variables, which are not supported by Exact.
Additionally, these formats permit floating point values, which may lead totrickyissues.
Rewrite constraints with fractional values to integral ones by multiplying with the lowest common multiple of the denominators.By default, Exact decides on the format based on the filename extension, but this can be overridden with the--formatoption.CompilationIn the root directory of Exact:cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
makeFor a debug build:cd build_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
makeFor more builds, similar build directories can be created.For installing system-wide or to theCMAKE_INSTALL_PREFIXroot, usemake install.DependenciesC++17 (i.e., a reasonably recent C++ compiler)Boostlibrary.
On a Debian/Ubuntu system, install withsudo apt install libboost-dev.Optionally:CoinUtilslibrary to parse MPS and LP file formats.
Use CMake option-Dcoinutils=ONafterinstalling the library.Optionally:SoPlexLP solver (see below).SoPlexExact supports an integration with the LP solverSoPlexto improve its search routine.
For this, checkout SoPlex from itsgit repositoryas a submodule, compile it in some separate directory, and configure the right CMake options when compiling Exact.By default, the following commands in Exact's root directory should work with a freshly checked out repository:git submodule init
    git submodule update

    mkdir soplex_build
    cd soplex_build
    cmake ../soplex -DBUILD_TESTING="0" -DSANITIZE_UNDEFINED="0" -DCMAKE_BUILD_TYPE="Release" -DBOOST="0" -DGMP="0" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS="0" -DZLIB="0"
    make -j 8

    cd ../build_debug
    cmake .. -DCMAKE_BUILD_TYPE="Release" -Dsoplex="ON"
    make -j 8The CMake optionssoplex_srcandsoplex_buildallow to look for SoPlex in a different location.LicenseExact is licensed under theAGPLv3. If this would hinder your intended usage, please contact @JoD.BenchmarksThe current set of benchmarks which is used to assess performance is availablehere.CitationsIf you use Exact, pleasecite this repositoryand the RoundingSat origin paper (which focuses on cutting planes conflict analysis):[EN18]J. Elffers, J. Nordström. Divide and Conquer: Towards Faster Pseudo-Boolean Solving.IJCAI 2018When relevant, please cite the following papers as well.Integration with SoPlex:[DGN20]J. Devriendt, A. Gleixner, J. Nordström. Learn to Relax: Integrating 0-1 Integer Linear Programming with Pseudo-Boolean Conflict-Driven Search.CPAIOR 2020 / Constraints journalWatched propagation:[D20]J. Devriendt. Watched Propagation for 0-1 Integer Linear Constraints.CP 2020Core-guided optimization:[DGDNS21]J. Devriendt, S. Gocht, E. Demirović, J. Nordström, P. J. Stuckey. Cutting to the Core of Pseudo-Boolean Optimization: Combining Core-Guided Search with Cutting Planes Reasoning.AAAI 2021