penaltymodel.PenaltyModelCache.insert_graph#

PenaltyModelCache.insert_graph(graph_like: int | Sequence[int] | Graph)[source]#

Insert a graph into the database.

Parameters:

graph – a NetworkX graph, an integer or a list of nodes.

Raises:

ValueError – If the nodes of the graph are not labelled [0, n).