pm4py.visualization.petri_net.util.vis_trans_shortest_paths module#

PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

pm4py.visualization.petri_net.util.vis_trans_shortest_paths.get_shortest_paths_from_trans(original_trans, trans, spaths, visited_arcs, visited_transitions, added_elements, rec_depth)[source]#

Get shortest paths from a given transition

Parameters:
  • original_trans – Original transition

  • trans – Current considered transition

  • spaths – Map of shortest paths

  • visited_arcs – Set of visited arcs

  • visited_transitions – Set of visited transitions

  • added_elements – Elements to add recursively

  • rec_depth – Recursion depth

Returns:

  • spaths – Map of shortest paths

  • visited_arcs – Set of visited arcs

  • added_elements – Elements to add recursively

pm4py.visualization.petri_net.util.vis_trans_shortest_paths.get_shortest_paths(net, enable_extension=False)[source]#

Gets shortest paths between visible transitions in a Petri net

Parameters:
  • net – Petri net

  • enable_extension – Enable decoration of more arcs, in a risky way, when needed

Returns:

Shortest paths

Return type:

spaths

pm4py.visualization.petri_net.util.vis_trans_shortest_paths.get_decorations_from_dfg_spaths_acticount(net, dfg, spaths, activities_count, variant='frequency', aggregation_measure=None)[source]#

Get decorations from Petrinet without doing any replay but based on DFG measures, shortest paths and activities count. The variant could be ‘frequency’ or ‘performance’. Aggregation measure could also be specified

Parameters:
  • net – Petri net

  • dfg – Directly-Follows graph

  • spaths – Shortest paths between visible transitions in the Petri net

  • activities_count – Count of activities in the Petri net

  • variant – Describe how to decorate the Petri net (could be frequency or performance)

  • aggregation_measure – Specifies the aggregation measure

  • stat_locale – Dict to locale the stat strings

Returns:

Decorations to use for the Petri net

Return type:

decorations