penaltymodel.PenaltyModelCache.insert_graph

PenaltyModelCache.insert_graph(graph_like: Union[int, Sequence[int], networkx.classes.graph.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).