ash_model.utils.networkx.from_networkx_graph

ash_model.utils.networkx.from_networkx_graph(graph, start, end=None, keep_attrs=False)[source]

Convert an undirected NetworkX Graph into an ASH with 2-node hyperedges.

Parameters:
  • graph (Graph) – Undirected NetworkX Graph.

  • start (int) – Start time of hyperedges and nodes.

  • end (int | None) – Optional end time of hyperedges and nodes.

  • keep_attrs (bool) – If True, node attributes are preserved.

Returns:

Populated ASH object.

Return type:

ASH