Add CMake build system, CLI, and project infrastructure - #1
Conversation
FetchContent-based CMake build that mirrors all Bazel targets including optional features (Gurobi, SCIP, bSuitor, Karp-Sipser, hashing, tcmalloc). Generates build-info.h and hashing-config.h, compiles app_io.proto, and builds all core binaries: app, runner, fork_runner, generate_experiment_config, binary_to_textproto.
Replaces verbose textproto input with clean CLI flags: --graph, --algorithms, --capacity, --ordering_method, --timeout, etc. Supports all algorithm pipelines (greedy, reductions, ils, ilp_exact, presolved_ilp, scip, local_improvement, unfold) and output formats (text, json, binary). Uses OBJECT library for algorithm_impl_lib to ensure all REGISTER_IMPL statics are linked.
Includes compare.sh script, 3 test hypergraph instances, and report showing 45/45 tests pass across greedy (5 orderings), reductions+unfold, and reductions+greedy+unfold pipelines at capacities 1/3/5.
- Bundle small.hgr and weighted.hgr example graphs for instant tryout - Add GitHub Actions CI: build (Release/Debug) + smoke test + unit tests - Add release workflow: builds and uploads Linux binary on tag push - Update README Quick Start to use bundled examples, add CI badge
Tap repo: HeiHGM/homebrew-bmatching
| std::vector<std::string> split(const std::string &s, char delim) { | ||
| std::vector<std::string> tokens; | ||
| std::istringstream stream(s); | ||
| std::string token; | ||
| while (std::getline(stream, token, delim)) { | ||
| // Trim whitespace | ||
| size_t start = token.find_first_not_of(" \t"); | ||
| size_t end = token.find_last_not_of(" \t"); | ||
| if (start != std::string::npos) { | ||
| tokens.push_back(token.substr(start, end - start + 1)); | ||
| } | ||
| } | ||
| return tokens; | ||
| } |
There was a problem hiding this comment.
why not use absl::StrSplit
There was a problem hiding this comment.
ok, we can use this.
| (*config.mutable_string_params())["ordering_method"] = | ||
| absl::GetFlag(FLAGS_ordering_method); |
There was a problem hiding this comment.
nit: Instead of (*config.mutable_string_params())["ordering_method"] = ...
use config.mutable_string_params()->insert({"key","value"});
There was a problem hiding this comment.
not sure what you mean with nit
| for cap in 1 3; do | ||
| run_test "$graph" "reductions+unfold" "$cap" \ | ||
| "command:\"run\" hypergraph { file_path:\"$graph\" format:\"hgr\" } config { algorithm_configs { algorithm_name:\"reductions\" string_params{key:\"assume_sorted\" value:\"true\"} } algorithm_configs { algorithm_name:\"unfold\" string_params{key:\"assume_sorted\" value:\"true\"} } capacity:$cap short_name:\"test\" }" \ | ||
| "--graph $graph --algorithms reductions,unfold --capacity $cap" | ||
| done |
There was a problem hiding this comment.
this test does not make sense. Why should you run reductions and directly unfold? unfold requires decisions made from other algorithms in between.
There was a problem hiding this comment.
feel free to remove; AI slop
There was a problem hiding this comment.
I don't think we need the report file as artifact in the repository.
There was a problem hiding this comment.
sure, lets remove it; had in the repo mainly for you.
| [](https://doi.org/10.7155/jgaa.v30i1.3166) | ||
|
|
||
| **Engineering Hypergraph $b$-Matching Algorithms** | ||
| **Tame your hypergraphs -- fast, modular b-matching at any scale.** |
There was a problem hiding this comment.
modular in this context could be mistaken for submodular.
| option(BMATCHING_USE_KARP_SIPSER "Enable Karp-Sipser algorithm" OFF) | ||
| option(BMATCHING_USE_HASHING "Enable hashing support (wide-integer)" OFF) | ||
| option(BMATCHING_USE_TCMALLOC "Use tcmalloc from gperftools" OFF) | ||
| option(BMATCHING_ENABLE_LOGGING "Enable easylogging++ logging output" ON) |
There was a problem hiding this comment.
I would not enable this by default.
There was a problem hiding this comment.
I acknowledge that the readme before was a bit unorganized.
However, I believe that the new state is not helpful, as it erases all information on how to reproduce experiments and use the runner framework. Maybe this can be moved into a different doc file.
There was a problem hiding this comment.
create a folder with reproducability/reproducability.md; in any case, there is the zenodo link right? we can mention that in the readme too.
- Use absl::StrSplit instead of custom split() function - Use proto map insert() instead of operator[] for params - Fix --inplace flag description (uses newer ILS interface) - Remove nonsensical reductions+unfold test case - Delete report.txt build artifact - Change BMATCHING_ENABLE_LOGGING default to OFF - Fix tagline: "flexible" instead of "modular" - Add Zenodo data link and reproducibility docs
Review feedback addressed
|
| ## 5. Plot Results | ||
|
|
||
| ```sh | ||
| python3 tools/plot/plot.py <path_to_experiment> <path_to_experiment>/visualisation.textproto |
There was a problem hiding this comment.
The python plotting tool is out of date (only the C++ version works correctly).
So this should be:
bazel run -c opt tools/plot:plot_cc <path_to_experiment> <path_to_experiment>/visualisation.textproto
or add pybind/matplotlibcpp17 bindings and use CMake
Summary
bmatching_cli-- user-friendly CLI with flag-based interface replacing verbose textproto inputcompile.sh-- one-command build script using all CPU coresbrew install --HEAD HeiHGM/bmatching/bmatchingexamples/for instant tryoutTest plan
brew install --HEAD HeiHGM/bmatching/bmatchingworksv1.0.0and verify release workflow produces binary