package hexaly
Build not yet checked sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
OCaml bindings for the Hexaly Optimizer
Install
dune-project
Dependency
Authors
Maintainers
Sources
hexaly-0.1.1.tar.gz
sha256=1ba0ccdaf2ba90a2c2f4908efbbb0a88e3ce9e032a66ed7a93fc70bf97f3a035
sha512=8c2072c022d930af26ca25ae25a595cbc2da9ec8358add14419b2fc8402b761bac27d77c0562bccf9eda2d2e2300a5b5a1d3c39f12866bdbc58d0d62142f6bb8
doc/CHANGELOG.html
Changelog
All notable changes to ocaml-hexaly will be documented in this file. Format follows Keep a Changelog; this project uses semantic versioning.
[0.1.1] - 2026-11-23
Packaging fixes found by opam-repository CI. No API changes.
Fixed
- Test suite: detect the mock backend with
Hexaly.backend ()instead of theHEXALY_BACKENDvariable. A build that falls back to the mock without that variable set (as in opam CI) ran real-solver-only tests against the mock and failed. - Link the C++ runtime on every non-MSVC toolchain:
-lc++on macOS and the BSDs,-lstdc++elsewhere. It was previously added only when OCaml reportedsystem = linux, so linking failed on FreeBSD, mingw, and Linux ppc64/s390x with OCaml 4.14. - Depend on
conf-c++, so opam installs a C++ compiler where one is missing (e.g. Cygwin).
[0.1.0] - 2026-11-22
First release. Working binding for the Hexaly Optimizer 14.5 C++ API.
Added
- Core modeling: bool/int/float decision variables; arithmetic, comparison, boolean, conditional, and array operators; constraints; single and multi-objective minimize/maximize.
- Scheduling support:
interval_var,optional_interval_var,start/end_/length/presenceoperators,interval_valuesolution readback. - Routing support:
list_var,set_var,count/index_of/contains/partition/disjoint/distinct/find/sort/intersection/union_/hulloperators,collection_valuesolution readback. - Math functions: sqrt, log, exp, pow, cos, sin, tan, ceil, floor, round.
- Typed errors:
Hexaly_error of Error.code * stringwith the 9-wayHxErrorCodemirror. - Callbacks:
add_callback/remove_callbackwith all 7 event types. The optimizer owns its callbacks; the C side holds a closure as a GC root only whilesolveruns, so an optimizer whose callback captures it is still collected. - Backend query:
Hexaly.backend ()returnsRealorMock.Hexaly.createwarns once on stderr when running on the mock unlessHEXALY_BACKEND=mockis set. Trampoline manages OCaml runtime lock across Hexaly's worker threads. - Inconsistency analysis:
compute_inconsistencyreturning anInconsistency.twithnb_causes,cause,to_string. - Warm start:
set_int_value/set_float_value/set_interval_valueon a solution before solve. - Advanced parameters:
set_advanced_int/_double/_stringfor Hexaly's named attribute knobs, plusset_warning_level,set_time_between_displays,set_time_between_ticks,set_iteration_between_ticks, objective thresholds, log file. - Version / license:
Version.major/minor/string/platform, programmatic license-path override. - Environment save:
save_environmentwrites a.hxmHexaly Modeler script (loadable by the Hexaly CLI; round-trip viaload_environmentis not currently supported by Hexaly itself). - Solver introspection:
state(Modeling/Running/Paused/Stopped),running_time,nb_iterations. - Pretty printers for
Error.code,State.t,Status.t,Callback_type.t,Inconsistency.t. - Mock backend: auto-selected when Hexaly isn't installed; passes the full test suite (interval/list/set/math tests skip on mock).
- Test suite: 23 alcotest tests covering core, regression, errors, scheduling, routing, math, introspection, callbacks, warm start, advanced params, environment, IIS.
- Examples: knapsack (optimum 309), TSP via list-var (optimum 24), single-machine scheduling via interval-var + pairwise non-overlap (optimum makespan 15).
- Benchmark:
bench/build_millionmeasures 1M-expression model build. - CI: GitHub Actions matrix on macOS + Linux × OCaml 4.14 / 5 (mock backend); odoc deployed to GitHub Pages.
Known limitations
- No
lambdaFunction/range/array(range, lambda, default); the Pythonic Hexaly TSP idiom isn't expressible; TSP example unrolls. - No
HxExternalFunction(custom evaluation callbacks during search). load_environmentaccepts a different format thansave_environmentproduces (a Hexaly limitation, documented in the .mli).
Multi-objective phases (added post 0.1.0 scope)
Hexaly.Phasemodule bound:create,get,nb_phases,set_time_limit/time_limit,set_iteration_limit/iteration_limit,set_optimized_objective/optimized_objective,set_enabled/is_enabled,to_string/pp.- Lexicographic optimization demonstrated in
examples/multi_objective.ml: bi-objective assignment finds cost-optimal 16, then balances load 3/3 across two workers.
Cross-platform build (added post 0.1.0 scope)
- Replaced the POSIX bash
configure.shwithsrc/config/discover.ml, a portable OCaml configurator usingdune-configurator. The same source needs no shell. Tested on Linux and macOS; Windows untested. - Library auto-detection from
$HEXALY_HOME,/opt/hexaly_*,/Library/hexaly_*,$HOME/hexaly_*,C:/hexaly_*,$ProgramFiles/hexaly_*. - Versioned soname discovery (e.g.
libhexaly145.dylib→-lhexaly145) instead of hardcoding-lhexaly.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page