pm4py.objects.dfg.utils package#
PM4Py – A Process Mining Library for Python
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
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
Submodules#
pm4py.objects.dfg.utils.dfg_utils module#
PM4Py – A Process Mining Library for Python
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
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.utils.dfg_utils.get_outgoing_edges(dfg)[source]#
Gets outgoing edges of the provided DFG graph
- pm4py.objects.dfg.utils.dfg_utils.get_ingoing_edges(dfg)[source]#
Get ingoing edges of the provided DFG graph
- pm4py.objects.dfg.utils.dfg_utils.infer_start_activities(dfg)[source]#
Infer start activities from a Directly-Follows Graph
Parameters#
- dfg
Directly-Follows Graph
Returns#
- start_activities
Start activities in the log
- pm4py.objects.dfg.utils.dfg_utils.infer_end_activities(dfg)[source]#
Infer end activities from a Directly-Follows Graph
Parameters#
- dfg
Directly-Follows Graph
Returns#
- end_activities
End activities in the log
- pm4py.objects.dfg.utils.dfg_utils.infer_start_activities_from_prev_connections_and_current_dfg(initial_dfg, dfg, activities, include_self=True)[source]#
Infer the start activities from the previous connections
Parameters#
- initial_dfg
Initial DFG
- dfg
Directly-follows graph
- activities
List of the activities contained in DFG
- pm4py.objects.dfg.utils.dfg_utils.infer_end_activities_from_succ_connections_and_current_dfg(initial_dfg, dfg, activities, include_self=True)[source]#
Infer the end activities from the previous connections
Parameters#
- initial_dfg
Initial DFG
- dfg
Directly-follows graph
- activities
List of the activities contained in DFG
- pm4py.objects.dfg.utils.dfg_utils.get_outputs_of_outside_activities_going_to_start_activities(initial_dfg, dfg, activities)[source]#
Get outputs of outside activities going to start activities
Parameters#
- initial_dfg
Initial DFG
- dfg
Directly-follows graph
- activities
Activities contained in the DFG
- pm4py.objects.dfg.utils.dfg_utils.get_inputs_of_outside_activities_reached_by_end_activities(initial_dfg, dfg, activities)[source]#
Get inputs of outside activities going to start activities
Parameters#
- initial_dfg
Initial DFG
- dfg
Directly-follows graph
- activities
Activities contained in the DFG
- pm4py.objects.dfg.utils.dfg_utils.get_activities_from_dfg(dfg)[source]#
Get the list of attributes directly from DFG graph
Parameters#
- dfg
Directly-Follows graph
Returns#
- list_activities
List of activities that are present in the DFG graph
- pm4py.objects.dfg.utils.dfg_utils.get_max_activity_count(dfg, act)[source]#
Get maximum count of an ingoing/outgoing edge related to an activity
Parameters#
- dfg
Directly-Follows graph
- act
Activity
Returns#
- max_value
Maximum count of ingoing/outgoing edges to attributes
- pm4py.objects.dfg.utils.dfg_utils.sum_ingoutg_val_activ(dictio, activity)[source]#
Gets the sum of ingoing/outgoing values of an activity
Parameters#
- dictio
Dictionary
- activity
Current examined activity
Returns#
summ
- pm4py.objects.dfg.utils.dfg_utils.max_occ_all_activ(dfg)[source]#
Get maximum ingoing/outgoing sum of values related to attributes in DFG graph
- pm4py.objects.dfg.utils.dfg_utils.max_occ_among_specif_activ(dfg, activities)[source]#
Get maximum ingoing/outgoing sum of values related to attributes in DFG graph (here attributes to consider are specified)
- pm4py.objects.dfg.utils.dfg_utils.sum_start_activities_count(dfg)[source]#
Gets the sum of start attributes count inside a DFG
Parameters#
- dfg
Directly-Follows graph
Returns#
Sum of start attributes count
- pm4py.objects.dfg.utils.dfg_utils.sum_end_activities_count(dfg)[source]#
Gets the sum of end attributes count inside a DFG
Parameters#
- dfg
Directly-Follows graph
Returns#
Sum of start attributes count
- pm4py.objects.dfg.utils.dfg_utils.sum_activities_count(dfg, activities, enable_halving=True)[source]#
Gets the sum of specified attributes count inside a DFG
Parameters#
- dfg
Directly-Follows graph
- activities
Activities to sum
- enable_halving
Halves the sum in specific occurrences
Returns#
Sum of start attributes count
- pm4py.objects.dfg.utils.dfg_utils.filter_dfg_on_act(dfg, listact)[source]#
Filter a DFG graph on a list of attributes (to produce a projected DFG graph)
Parameters#
- dfg
Current DFG graph
- listact
List of attributes to filter on
- pm4py.objects.dfg.utils.dfg_utils.negate(dfg)[source]#
Negate relationship in the DFG graph
Parameters#
- dfg
Directly-Follows graph
Returns#
- negated_dfg
Negated Directly-Follows graph (for parallel cut detection)
- pm4py.objects.dfg.utils.dfg_utils.get_activities_direction(dfg, activities)[source]#
Calculate activities direction (in a similar way to Heuristics Miner)
Parameters#
- dfg
Directly-follows graph
- activities
(if provided) activities of the subtree
Returns#
- direction
Dictionary that contains for each direction a number that goes from -1 (all ingoing edges) to 1 (all outgoing edges)
- pm4py.objects.dfg.utils.dfg_utils.get_activities_dirlist(activities_direction)[source]#
Form an ordered list out of a dictionary that contains for each activity the direction (going from -1 if all ingoing edges, to 1 if all outgoing edges)
Parameters#
- activities_direction
Dictionary that contains for each direction a number that goes from -1 (all ingoing edges) to 1 (all outgoing edges)
Returns#
- dirlist
Sorted list of couples of activity plus the direction
- pm4py.objects.dfg.utils.dfg_utils.get_activities_self_loop(dfg)[source]#
Get attributes that are in self-loop in this subtree
Parameters#
- dfg
Directly-follows graph
Returns#
- self_loop_act
Activities of the graph that are in subloop
- pm4py.objects.dfg.utils.dfg_utils.get_connected_components(ingoing, outgoing, activities, force_insert_missing_acti=True)[source]#
Get connected components in the DFG graph
Parameters#
- ingoing
Ingoing attributes
- outgoing
Outgoing attributes
- activities
Activities to consider
- force_insert_missing_acti
Force the insertion of a missing activity
- pm4py.objects.dfg.utils.dfg_utils.add_to_most_probable_component(comps, act2, ingoing, outgoing)[source]#
Adds a lost component in parallel cut detection to the most probable component
Parameters#
- comps
Connected components
- act2
Activity that has been missed
- ingoing
Map of ingoing attributes
- outgoing
Map of outgoing attributes
Returns#
- comps
Fixed connected components
- pm4py.objects.dfg.utils.dfg_utils.get_all_activities_connected_as_output_to_activity(dfg, activity)[source]#
Gets all the activities that are connected as output to a given activity
Parameters#
- dfg
Directly-follows graph
- activity
Activity
Returns#
- all_activities
All activities connected as output to a given activity
- pm4py.objects.dfg.utils.dfg_utils.get_all_activities_connected_as_input_to_activity(dfg, activity)[source]#
Gets all the activities that are connected as input to a given activity
Parameters#
- dfg
Directly-follows graph
- activity
Activity
Returns#
- all_activities
All activities connected as input to a given activities
- pm4py.objects.dfg.utils.dfg_utils.get_dfg_np_matrix(dfg)[source]#
Gets a Numpy matrix describing the DFG graph, along with a dictionary making correspondence between indexes and activities names
Parameters#
- dfg
Directly-Follows graph
Returns#
- matrix
Matrix describing the DFG
- index_corresp
Dictionary making correspondence between indexes and activities names
- pm4py.objects.dfg.utils.dfg_utils.get_dfg_sa_ea_act_from_variants(variants, parameters=None)[source]#
Gets the DFG, the start and end activities, and the activities from the dictionary/set/list of variants in the log
Parameters#
- variants
Dictionary/set/list of variants
- parameters
Parameters of the algorithm, including: - variants_sep: the delimiter splitting activities in a variant
Returns#
- dfg
DFG
- list_act
List of different activities
- start_activities
Start activities
- end_activities
End activities
- pm4py.objects.dfg.utils.dfg_utils.transform_dfg_to_directed_nx_graph(dfg, activities=None)[source]#
Transform DFG to directed NetworkX graph
Returns#
- G
NetworkX digraph
- nodes_map
Correspondence between digraph nodes and activities
- pm4py.objects.dfg.utils.dfg_utils.get_successors(dfg, activities_model=None)[source]#
Gets the successors of any node of the DFG graph
Parameters#
- dfg
DFG
- activities_model
Activities of the process model (if None, it is inferred from the process model)
Returns#
- successors
Dictionary associating to each node all the descendants
- pm4py.objects.dfg.utils.dfg_utils.get_predecessors(dfg, activities_model=None)[source]#
Gets the predecessors of any node of the DFG graph
Parameters#
- dfg
DFG
- activities_model
Activities of the process model (if None, it is inferred from the process model)
Returns#
- predecessors
Dictionary associating to each node all the ascendants
- pm4py.objects.dfg.utils.dfg_utils.get_transitive_relations(dfg, alphabet)[source]#
Parameters#
- dfg
directly follows relation (counter describing activity pairs)
Returns#
tuple with two dicts. first argument maps an activit on all other activities that are able to reach the activity (‘transitive pre set’) second argument maps an activity on all other activities that it can reach (transitively) (‘transitive post set’)