Network Analysis Module

Network Analysis Module for DRIADA

General-purpose graph analysis: spectral decomposition, thermodynamic entropy, quantum-inspired measures, community detection, and visualization for any graph or network. Works equally well with structural connectomes, correlation matrices, or any other graph representation.

The Network class also serves as the base for ProximityGraph (in dim_reduction), so graph-based DR methods produce objects with full spectral analysis capabilities.

General-purpose graph analysis: spectral decomposition, thermodynamic entropy, quantum-inspired measures, community detection, and visualization for any graph.

The Network class is also the base for ProximityGraph (in dim_reduction), which means graph-based dimensionality reduction methods (Isomap, LLE, Laplacian Eigenmaps, diffusion maps) produce objects with full spectral and topological analysis capabilities.

Module Components

Usage Example

from driada.network import Network
from driada.network.graph_utils import get_giant_cc_from_graph
import numpy as np
import scipy.sparse as sp

# Create example adjacency matrix
n_nodes = 20
adjacency_matrix = sp.random(n_nodes, n_nodes, density=0.1, format='csr')
adjacency_matrix = adjacency_matrix + adjacency_matrix.T  # Make symmetric

# Create network from adjacency matrix
net = Network(adj=adjacency_matrix, preprocessing='giant_cc')

# Analyze network properties
print(f"Nodes: {net.n}, Edges: {net.graph.number_of_edges()}")
print(f"Mean degree: {net.deg.mean():.2f}")