pm4py.convert.convert_petri_net_to_networkx#

pm4py.convert.convert_petri_net_to_networkx(net: PetriNet, im: Marking, fm: Marking) DiGraph[source]#

Converts a Petri net to a NetworkX DiGraph.

Each place and transition in the Petri net is represented as a node in the graph.

Return type:

DiGraph

Parameters:
  • net (PetriNet) – The Petri net to convert.

  • im (Marking) – The initial marking of the Petri net.

  • fm (Marking) – The final marking of the Petri net.

Returns:

A nx.DiGraph object representing the Petri net.