1 unstable release
new 0.1.0 | Apr 4, 2025 |
---|
#8 in #graph-traversal
Used in 45 crates
(7 directly)
15KB
132 lines
iCentral Visit Markers
icentral-visit-markers
is a Rust crate designed for efficient manipulation and tracking of graph traversal states, especially useful in algorithms involving graph exploration, such as depth-first or breadth-first search. The crate provides a robust mechanism to maintain node visitation states, encapsulating them in a structured and flexible manner.
Features
- Visit Tracking: Efficiently track whether specific nodes within a graph are visited, supporting both indexed and mapped structures for storage flexibility.
- Macro Support: Utilizes macros to streamline the delegation of functionalities related to marker operations.
- Flexible Initialization: Instantiate marker sets from given nodes, with customizable initial visited states.
- Comprehensive API: Includes methods for marking nodes as visited/unvisited, iterating over unvisited nodes, and reinitializing marker sets.
- Debugging Outputs: Debug level logs provide insights during development and computation, aiding in understanding and optimizing graph traversal processes.
Getting Started
To start using icentral-visit-markers
in your project, add it to your Cargo.toml
:
[dependencies]
icentral-visit-markers = "0.1.0"
Usage Example
use icentral_visit_markers::VisitMarkers;
let nodes = vec![NodeId(1), NodeId(2), NodeId(3)];
let mut markers = VisitMarkers::new_from_nodes(nodes, "example_markers");
markers.visit(NodeId(1));
assert!(markers.visited(NodeId(1)));
assert!(!markers.visited(NodeId(2)));
let unvisited_nodes = markers.iter_unvisited();
License
This project is licensed under the MIT License.
This README.md file was generated by an AI model and may not be 100% accurate, however, it should be pretty good.
This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.
For progress updates, see the workspacer rust project.
Dependencies
~15–25MB
~386K SLoC