ash_model.utils.projections.bipartite_projection

ash_model.utils.projections.bipartite_projection(h, start=None, end=None, keep_attrs=False)[source]

Returns a NetworkX Graph object that is the bipartite projection of the given ASH object. The bipartite projection of a hypergraph is a graph constructed by placing an edge between every node and every hyperedge that contains it.

Parameters:
  • h (ASH) – The ASH object to be projected.

  • start (int | None) – The start time of the projection (optional).

  • end (int | None) – The end time of the projection (optional).

  • keep_attrs (bool) – If True, the attributes of the nodes in the ASH will be preserved in the resulting NetworkX graph.

Returns:

A NetworkX Graph object representing the bipartite projection of the ASH.

Return type:

Graph