Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #621 +/- ##
========================================
Coverage 96.82% 96.82%
========================================
Files 236 238 +2
Lines 31002 31129 +127
========================================
+ Hits 30017 30140 +123
- Misses 985 989 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds a new HamiltonianPath satisfaction model to the graph models set, integrating it with tests, CLI JSON dispatch, an example, and generated schema docs so it can participate in the library’s standard model/solver workflows.
Changes:
- Introduces
HamiltonianPath<G>model with evaluation logic and variant declaration. - Adds unit tests and an executable example, and wires the example into the examples test suite.
- Registers the model in library exports/prelude, CLI alias + JSON dispatch, and updates generated
problem_schemas.json.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/models/graph/hamiltonian_path.rs |
New model implementation + schema registration + variants + tests module hook |
src/unit_tests/models/graph/hamiltonian_path.rs |
Unit tests for evaluation, brute force, serialization, helpers |
src/models/graph/mod.rs |
Exposes the new model module and adds it to graph docs/exports |
src/models/mod.rs |
Re-exports HamiltonianPath from models |
src/lib.rs |
Adds HamiltonianPath to the crate prelude |
problemreductions-cli/src/problem_name.rs |
Adds alias resolution for hamiltonianpath |
problemreductions-cli/src/dispatch.rs |
Adds JSON load/serialize dispatch for HamiltonianPath |
examples/hamiltonian_path.rs |
New example demonstrating construction + brute force enumeration |
tests/suites/examples.rs |
Runs the new example under the examples test suite |
docs/src/reductions/problem_schemas.json |
Generated schema entry for HamiltonianPath |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// | ||
| /// Given a graph G = (V, E), determine whether G contains a Hamiltonian path, | ||
| /// i.e., a simple path that visits every vertex exactly once. | ||
| /// |
| let solution = solver.find_satisfying(&problem); | ||
| assert!(solution.is_some()); | ||
| assert!(problem.evaluate(&solution.unwrap())); | ||
|
|
| for sol in &all { | ||
| assert!(problem.evaluate(sol)); | ||
| } |
| "MaximumMatching" => deser_opt::<MaximumMatching<SimpleGraph, i32>>(data), | ||
| "MinimumDominatingSet" => deser_opt::<MinimumDominatingSet<SimpleGraph, i32>>(data), | ||
| "GraphPartitioning" => deser_opt::<GraphPartitioning<SimpleGraph>>(data), | ||
| "HamiltonianPath" => deser_sat::<HamiltonianPath<SimpleGraph>>(data), | ||
| "MaxCut" => deser_opt::<MaxCut<SimpleGraph, i32>>(data), |
| fn dims(&self) -> Vec<usize> { | ||
| let n = self.graph.num_vertices(); | ||
| vec![n; n] | ||
| } |
- Document configuration semantics (vertex ordering/permutation) in HamiltonianPath struct doc comment, including dims() encoding rationale - Add explicit `use crate::traits::Problem` import in test_hamiltonian_path_brute_force for consistency with other test functions - Add CLI create support for HamiltonianPath: example_for hint, create_problem match arm, create_random match arm, and updated error message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Pipeline Report
🤖 Generated by review-pipeline |
Review Pipeline Report
🤖 Generated by review-pipeline |
…-path # Conflicts: # src/lib.rs # src/models/mod.rs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
HamiltonianPathsatisfaction problem model (graph-based,Metric = bool)Fixes #217