1 unstable release
new 0.1.0 | Apr 4, 2025 |
---|
#12 in #bfs
Used in 5 crates
(3 directly)
17KB
103 lines
ICentral Workspace Map
icentral-workspace-map
is a Rust crate designed for efficient workspace management within graph systems. It utilizes a MaybeIndexedMap
to map nodes in a graph to their corresponding workspaces, providing both indexed and non-indexed modes for flexible management.
Features
- Efficient Workspace Initialization: Create empty indexed or mapped workspace collections with ease.
- Graph Length Management: Pre-allocate resources for a given graph length, optimizing memory usage and performance.
- Workspace Manipulation: Convenient methods for accessing, modifying, and setting workspaces for different graph nodes.
- Graph Traversal Algorithms: Supports Breadth-First Search (BFS) and Reverse BFS (RBFS) operations which can be parallelized in future versions.
Usage
Creating a WorkspaceMap
To start using the WorkspaceMap
, initialize it with a desired length and name:
use icentral_workspace_map::WorkspaceMap;
let workspace_map = WorkspaceMap::new(10, "example_map");
Manipulating Workspaces
- Check for Workspace: Determine the existence of a workspace for a node using
has_workspace
. - Access Workspace: Use
workspace_ref
andworkspace_mut
to obtain immutable and mutable references, respectively. - Set Workspace: Directly set a workspace with
set_workspace_for_node
.
Graph Traversal
Perform BFS and RBFS graph traversal with methods that can be optimized for parallel execution:
workspace_map.bbfs(None, &component);
workspace_map.bbfs_rbfs(&mut scores, None, &mut component);
Note
This README.md file was generated by an AI model. While it aims to be informative and accurate, there may be nuances not fully captured.
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
~385K SLoC