topobench.transforms.liftings.graph2hypergraph.forman_ricci_curvature_lifting module#

This module implements the HypergraphFormanRicciCurvatureLifting class.

class Graph2HypergraphLifting(**kwargs)#

Bases: GraphLifting

Abstract class for lifting graphs to hypergraphs.

Parameters:
**kwargsoptional

Additional arguments for the class.

__init__(**kwargs)#
class HypergraphFormanRicciCurvatureLifting(network_type='weighted', threshold_type='quantile', threshold_direction='above', threshold=0.1, **kwargs)#

Bases: Graph2HypergraphLifting

Lift graphs to hypergraph domain using Forman-Ricci curvature based backbone estimation.

This lifting identifies a network’s structure-preserving, coarse geometry, i.e. its backbones, which lend themselves specifically to model information flows across wide areas of the network via hyperedges. To identify this coarse geometry we apply Forman-Ricci curvature to the original graph. Forman-Ricci curvature defines an edge-based network characteristic that reveals properties of a graph’s community structure. In particular high absolute Forman-Ricci curvature exhibits a network’s backbone, a coarse, structure preserving graph geometry that forms connections between major communities, most suitable to form hyperedges. In addition, Forman-Ricci curvature was found to be especially useful for network analysis since its intuitive notion allows for efficient computation that scales to large networks sizes.

Parameters:
network_typestr, optional

Network type may be weighted or unweighted. Default is “weighted”.

threshold_typestr, optional

Type of threshold (either based on quantile or absolute). Default is “quantile”.

threshold_directionstr, optional

Direction whether to prune values above or below threshold. Default is “above”.

thresholdfloat, optional

Absolute value or quantile to estimate cutoff threshold from Forman-Ricci curvature distribution to prune network and reveal backbone. Default is 0.1.

**kwargsdict, optional

Additional arguments for the class.

__init__(network_type='weighted', threshold_type='quantile', threshold_direction='above', threshold=0.1, **kwargs)#
lift_topology(data)#

Lift the topology of a graph to hypergraph domain using Forman-Ricci curvature based backbone estimation.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.