| Crates.io | amari-network |
| lib.rs | amari-network |
| version | 0.17.0 |
| created_at | 2025-10-10 01:07:34.174832+00 |
| updated_at | 2026-01-11 22:33:36.873261+00 |
| description | Geometric network analysis using Clifford algebra and tropical algebra |
| homepage | https://github.com/justinelliottcobb/Amari |
| repository | https://github.com/justinelliottcobb/Amari |
| max_upload_size | |
| id | 1876378 |
| size | 179,636 |
Geometric network analysis using Clifford algebra and tropical algebra
amari-network provides advanced graph and network analysis tools where nodes are embedded in Clifford algebra (geometric algebra) space. This unique approach enables:
Networks are embedded in Clifford algebra spaces Cl(P,Q,R) with signature (P,Q,R):
Each node is represented as a multivector combining scalars, vectors, bivectors, and higher-grade elements.
Shortest path optimization uses tropical arithmetic where:
This transforms shortest path problems into elegant matrix operations in the tropical semiring.
Add to your Cargo.toml:
[dependencies]
amari-network = "0.9.0"
use amari_network::{GeometricNetwork, NodeMetadata};
use amari_core::Vector;
// Create a network in 3D Euclidean space (signature 3,0,0)
let mut network = GeometricNetwork::<3, 0, 0>::new();
// Add nodes at specific geometric positions
let node1 = network.add_node_with_metadata(
Vector::from_components(1.0, 0.0, 0.0).mv,
NodeMetadata::with_label("Node 1").with_property("importance", 0.8)
);
let node2 = network.add_node_with_metadata(
Vector::from_components(0.0, 1.0, 0.0).mv,
NodeMetadata::with_label("Node 2").with_property("importance", 0.9)
);
// Connect nodes with weighted edges
network.add_edge(node1, node2, 1.0)?;
// Compute geometric distance using Clifford algebra
let distance = network.geometric_distance(node1, node2)?;
println!("Geometric distance: {:.2}", distance); // Should be 1.414 (√2)
// Find communities using geometric clustering
let communities = network.find_communities(2)?;
// Simulate information diffusion
let diffusion = network.simulate_diffusion(&[node1], 10, 0.5)?;
// Convert to tropical network for efficient path operations
let tropical_net = network.to_tropical_network()?;
The crate includes comprehensive examples demonstrating different aspects:
# Basic network operations and analysis
cargo run --example basic_network
# Community detection using geometric clustering
cargo run --example community_detection
# Information diffusion simulation
cargo run --example information_diffusion
# Tropical algebra path finding
cargo run --example tropical_pathfinding
# Advanced geometric analysis across different spaces
cargo run --example geometric_analysis
GeometricNetwork<P,Q,R>: Main network structure with const generic signatureGeometricEdge: Weighted directed edge between nodesNodeMetadata: Optional labels and properties for nodesCommunity<P,Q,R>: Community detection results with geometric centroidsPropagationAnalysis: Information diffusion analysis resultsTropicalNetwork: Tropical algebra representation for optimizationnew(), add_node(), add_edge(), add_undirected_edge()geometric_distance(), compute_geometric_centrality()shortest_path(), shortest_geometric_path(), all_pairs_shortest_paths()find_communities(), spectral_clustering(), simulate_diffusion()to_tropical_network()amari-network seamlessly integrates with other Amari crates:
amari-core: Provides Clifford algebra operations and multivector typesamari-tropical: Supplies tropical number arithmetic and operationsamari-dual: Can be used for automatic differentiation of network metricsamari-gpu: Enables GPU acceleration of matrix computationsThe crate includes comprehensive tests:
Run tests:
cargo test --package amari-network
cargo test --package amari-network --test integration
Contributions are welcome! Areas of particular interest:
Licensed under either of:
at your option.
If you use this crate in academic work, please cite:
@software{amari_network,
title = {Amari Network Analysis: Geometric Network Analysis using Clifford Algebra},
author = {Amari Contributors},
year = {2024},
url = {https://github.com/justinelliottcobb/Amari},
version = {0.9.0}
}
Part of the Amari mathematical computing ecosystem