#indexing #connectivity #graph #graphs #nodemapping

icentral-conn-vertex-map

The icentral-conn-vertex-map crate provides a robust data structure for managing node-to-node connectivity in computational graphs, with both indexed and mapped modes

1 unstable release

new 0.1.0 Apr 4, 2025

#16 in #connectivity


Used in 33 crates (3 directly)

MIT/Apache

15KB

iCentral Conn Vertex Map

The icentral-conn-vertex-map crate offers a sophisticated data structure designed for efficient representation and manipulation of connectivity mappings between nodes in a computational graph. Designed for high-performance applications, it allows developers to manage connectivity using a ConnVertexMap which stores and retrieves node-to-node connection information with optimal efficiency.

Features

  • Efficient Connectivity Management: Quickly manage connections between nodes with robust methods such as vertices_for_node, set_vertex_map_for_node, and clear.
  • Mutable and Immutable Access: Seamlessly switch between mutable and immutable data access through methods that either safely reference or mutate node connections.
  • Iterative Access: Utilize iter for traversing connectivity mappings, facilitating streamlined operations over node connections.
  • Flexibility with Indexed and Mapped Modes: Employ empty_indexed or empty_mapped constructors to initialize the map in states optimized for specific connectivity scenarios.

Technical Details

Storage Structure

At the heart of the ConnVertexMap is a MaybeIndexedMap, which offers an advanced mapping solution capable of efficient storage and retrieval operations, catering to complex node connectivity patterns.

API Overview

  • vertices_for_node: Retrieve a list of connected node IDs for a specific node.
  • vertices_for_node_mut: Obtain a mutable reference to node connections, enabling dynamic updates.
  • set_vertex_map_for_node: Define or redefine the connections for a node, allowing reintegration into the network topology.
  • has_mapping_for_node: Check existence of a node mapping, aiding in data validation and integrity checks.
  • clear: Reset the entire connectivity map, invaluable in scenarios requiring quick reinitialization.

Usage

use icentral_conn_vertex_map::ConnVertexMap;

fn main() {
    let mut conn_map = ConnVertexMap::empty_indexed("My Graph");
    let node_id = 42;
    let connected_nodes = vec![1, 2, 3];

    conn_map.set_vertex_map_for_node(node_id, connected_nodes);

    if conn_map.has_mapping_for_node(node_id) {
        println!("Node {} is connected to: {:?}", node_id, conn_map.vertices_for_node(node_id));
    }

    conn_map.clear();
    assert!(!conn_map.has_mapping_for_node(node_id));
}

Conclusion

The icentral-conn-vertex-map is an essential tool for developers working with graph data structures requiring mutable connectivity mappings. Its methods support robust, efficient, and flexible data operations that are crucial for addressing real-world computational problems in networked environments.


This README was generated by an AI model and may not be 100% accurate. However, it should provide a good initial understanding of the crate's functionality.

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