-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Implement Hamiltonian Cycle Finder #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Hamiltonian Cycle Finder #731
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #731 +/- ##
==========================================
+ Coverage 94.95% 94.96% +0.01%
==========================================
Files 303 304 +1
Lines 22533 22584 +51
==========================================
+ Hits 21396 21447 +51
Misses 1137 1137 ☔ View full report in Codecov by Sentry. |
Can you have a look on this PR (and other PRs in the backtracking category) and review them @vil02. |
Can you review this PR, @vil02? |
Failing CI will be fixed by #754. |
27e5351
to
300fb32
Compare
- Add custom error `AdjMatError` type with 3 varients: `EmptyMat`, `StartOutOfBound` and `ImproperMat` - Add tests for exceptional cases - Change adjaceny matrix repr to `Vec<Vec<bool>>`
- Move error handling to appropriate methods - Add `num_vertices` method
300fb32
to
559b865
Compare
- Rename custom error to more related name, from `AdjMatError` to `FindHamiltonialCycleError` - Use `HashSet` to retrieve visited vextex in `O(1)` time - Chain method when propagating error - Add test for directed graph
- Write error names in full word format - Use `Vec<bool>` to store visited vertices - Represent path as `Vec<Option<usize>>` where the undefined vertex is represented as `None` - Add suggested tests
Pull Request Template
Description
See details in the implementation
Type of change
Checklist:
cargo clippy --all -- -D warnings
just before my last commit and fixed any issue that was found.cargo fmt
just before my last commit.cargo test
just before my last commit and all tests passed.mod.rs
file within its own folder, and in any parent folder(s).DIRECTORY.md
with the correct link.COUNTRIBUTING.md
and my code follows its guidelines.