pm4py.objects.dfg.util 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.objects.dfg.util.get_vertices(dfg: DirectlyFollowsGraph) Collection[Any][source]#
Returns the vertices of the dfg
- Parameters:
dfg – input directly follows graph
- Return type:
Collection[Any]
- pm4py.objects.dfg.util.get_outgoing_arcs(dfg: DirectlyFollowsGraph) Dict[Any, Dict[Any, int]][source]#
Returns the outgoing arcs of the provided DFG graph. Returns a dictionary mapping each ‘source’ node onto its set of ‘target’ nodes and associated frequency.
- Parameters:
dfg –
DFGobject- Return type:
Dict[str, Counter[str]]
- pm4py.objects.dfg.util.get_incoming_arcs(dfg: DirectlyFollowsGraph) Dict[Any, Dict[Any, int]][source]#
Returns the incoming arcs of the provided DFG graph. Returns a dictionary mapping each ‘target’ node onto its set of ‘source’ nodes and associated frequency.
- Parameters:
dfg –
DFGobject- Return type:
Dict[str, Counter[str]]
- pm4py.objects.dfg.util.get_source_vertices(dfg: DirectlyFollowsGraph) Collection[Any][source]#
Gets source vertices from a Directly-Follows Graph. Vertices are returned that have no incoming arcs
- Parameters:
dfg –
DFGobject- Return type:
Collection[Any]
- pm4py.objects.dfg.util.get_sink_vertices(dfg: DirectlyFollowsGraph) Collection[Any][source]#
Gets sink vertices from a Directly-Follows Graph. Vertices are returned that have no outgoing arcs
- Parameters:
dfg –
DFGobject- Return type:
Collection[Any]
- pm4py.objects.dfg.util.get_transitive_relations(dfg: DirectlyFollowsGraph) Tuple[Dict[Any, Collection[Any]], Dict[Any, Collection[Any]]][source]#
Computes the full transitive relations in both directions (all activities reachable from a given activity and all activities that can reach the activity).
- Parameters:
dfg (dict) – Directly Follows Graph (DFG) object.
- Returns:
A tuple containing: - First argument: maps an activity to all other activities that are able to reach it (‘transitive pre-set’). - Second argument: maps an activity to all other activities that it can reach (‘transitive post-set’).
- Return type:
Tuple[Dict[Any, Collection[Any]], Dict[Any, Collection[Any]]]
- pm4py.objects.dfg.util.get_vertex_frequencies(dfg: DirectlyFollowsGraph) Dict[Any, int][source]#
Computes the number of times a vertex in the dfg is visited. The number equals the number of occurrences in the underlying log and is computed by summing up the incoming arc frequency and the number of starts in the vertex. The value is equal to the number of outgoing arcs combined with the number of endings of the vertex.
- pm4py.objects.dfg.util.as_nx_graph(dfg: DirectlyFollowsGraph)[source]#
- pm4py.objects.dfg.util.get_edges(dfg: DirectlyFollowsGraph) Collection[Tuple[Any, Any]][source]#