pm4py.analysis.simplicity_petri_net#

pm4py.analysis.simplicity_petri_net(net: PetriNet, im: Marking, fm: Marking, variant: str | None = 'arc_degree') float[source]#

Computes the simplicity metric for a given Petri net model.

Three available approaches are supported: - Arc Degree Simplicity: Described in the paper “ProDiGen: Mining complete, precise and minimal structure process models with a genetic algorithm.” by Vázquez-Barreiros, Borja, Manuel Mucientes, and Manuel Lama. Information Sciences, 294 (2015): 315-333. - Extended Cardoso Metric: Described in the paper “Complexity Metrics for Workflow Nets” by Lassen, Kristian Bisgaard, and Wil MP van der Aalst. - Extended Cyclomatic Metric: Also described in the paper “Complexity Metrics for Workflow Nets” by Lassen, Kristian Bisgaard, and Wil MP van der Aalst.

Parameters:
  • net (PetriNet) – The Petri net for which to compute simplicity.

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

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

  • variant – The simplicity metric variant to use (‘arc_degree’, ‘extended_cardoso’, ‘extended_cyclomatic’).

Returns:

The computed simplicity value.

Return type:

float

import pm4py

net, im, fm = pm4py.discover_petri_net_inductive(
    dataframe,
    activity_key='concept:name',
    case_id_key='case:concept:name',
    timestamp_key='time:timestamp'
)
simplicity = pm4py.simplicity_petri_net(net, im, fm, variant='arc_degree')