#graph-node #graph #edge #connectivity #node #bidirectional #api-bindings

icentral-edge

Icetral-edge provides a utility for managing graph edges, enabling node connectivity and manipulation. This crate is exemplary for implementing robust graph data structures.

1 unstable release

new 0.1.0 Apr 4, 2025

#15 in #connectivity


Used in 52 crates (32 directly)

MIT/Apache

15KB
70 lines

icentral-edge

The icentral-edge crate provides a robust abstraction for handling graph edges within computational systems. Leveraging the flexibility afforded by Rust's type system, it efficiently models the bidirectional connectivity between nodes in a graph.

Features

  • Edge Representation: Each Edge struct captures a connection between two nodes, facilitating operations such as traversal and graph analysis.
  • Debugging and Display: Implements fmt::Debug and fmt::Display for an intuitive representation of edges.
  • Utility Methods: Create edges with specific nodes or random ones, check connectivity, and generate reversed edges using provided methods.

Usage

Add the following dependency to your Cargo.toml:

[dependencies]
icentral-edge = "0.1.0"

Example:

use icentral_edge::Edge;

fn main() {
    let edge = Edge::new_with_ids(1, 2);
    println!("{}", edge);  // Output: (1 <-> 2)

    if edge.connects_nodes(1, 2) {
        println!("Nodes are connected by edge.");
    }

    let reversed_edge = edge.reversed();
    println!("Reversed: {}", reversed_edge);  // Output: (2 <-> 1)
}

Concepts

This crate extensively uses Rust's derivable traits to ensure edges are ordered, comparable, and hashable, aiding both the storage and retrieval processes in large-scale graph models.

Versions

This documentation is generated for version 0.1.0.


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
~387K SLoC