xgi.convert.line_graph

Method for converting to a line graph.

Functions

xgi.convert.line_graph.to_line_graph(H, s=1, weights=None)[source]

The s-line graph of the hypergraph.

The s-line graph of the hypergraph H is the graph whose nodes correspond to each hyperedge in H, linked together if they share at least s vertices.

Optional edge weights correspond to the size of the intersection between the hyperedges, optionally normalized by the size of the smaller hyperedge.

Parameters:
  • H (Hypergraph) – The hypergraph of interest

  • s (int) – The intersection size to consider edges as connected, by default 1.

  • weights (str or None) – Specify whether to return a weighted line graph. If None, returns an unweighted line graph. If ‘absolute’, includes edge weights corresponding to the size of intersection between hyperedges. If ‘normalized’, includes edge weights normalized by the size of the smaller hyperedge.

Returns:

LG – The line graph associated to the Hypergraph

Return type:

networkx.Graph

References

“Hypernetwork science via high-order hypergraph walks”, by Sinan G. Aksoy, Cliff Joslyn, Carlos Ortiz Marrero, Brenda Praggastis & Emilie Purvine. https://doi.org/10.1140/epjds/s13688-020-00231-0