Show HN: Selen โ€“ Constraint Satisfaction Solver in Rust (github.com)

🤖 AI Summary
Selen is a new constraint satisfaction problem (CSP) solver library written in Rust (crate selen = "0.8.4") with zero external dependencies and an MIT license. It offers both a natural mathematical syntax via a post! macro and a programmatic runtime API, so developers can declare integer/float variables and express constraints either tersely (x + y <= z) or imperatively (m.new(x.add(y).le(z))). That makes it easy to drop into Rust projects, CI pipelines or embedded systems without pulling in C libraries or complex FFI. Technically, Selen implements a wide range of constraint types—arithmetic (+, -, *, /, %, abs, min, max, sum), comparisons (==, !=, <, <=, >, >=), boolean logic (and/or/not with variadic/array forms), global constraints (alldiff, allequal, element, count, table), ordering chains, cardinality (at_least/at_most/exactly) and conditional constraints (if_then, if_then_else). Example apps include Sudoku, N-Queens, graph coloring and industrial/financial resource-allocation demos. A shown Sudoku run solved a 17-clue puzzle in ~2289.9 ms with 538 propagations and 25 search nodes (≈21.5 propagations/node), indicating a propagation-driven search approach. Overall, Selen is significant for the AI/ML and operations-research communities as a lightweight, Rust-native CSP engine suitable for prototyping, production embedding, and deterministic constraint-based modeling.
Loading comments...
loading comments...