pm4py.algo.conformance.alignments.process_tree.variants.dynamic_programming 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.algo.conformance.alignments.process_tree.variants.dynamic_programming.clear_global_caches()[source]#
Clear all global caches to free memory
- class pm4py.algo.conformance.alignments.process_tree.variants.dynamic_programming.Parameters(*values)[source]#
Bases:
Enum- ACTIVITY_KEY = 'pm4py:param:activity_key'#
- SHOW_PROGRESS_BAR = 'show_progress_bar'#
- MAX_TOTAL_TIME = 'max_total_time'#
- USE_GLOBAL_CACHE = 'use_global_cache'#
- BATCH_SIZE = 'batch_size'#
- CLEAR_GLOBAL_CACHE = 'clear_global_cache'#
- pm4py.algo.conformance.alignments.process_tree.variants.dynamic_programming.align_trace_with_process_tree(trace, tree, use_global_cache=False)[source]#
Aligns a trace with a process tree using dynamic programming. Returns both the cost and the actual alignment.
Version based on: A Dynamic Programming Approach for Alignments on Process Trees http://processquerying.com/wp-content/uploads/2024/09/PQMI_2024_279_A_Dynamic_Programming_Approach_for_Alignments_on_Process_Trees.pdf
Enhanced with global caching and memory optimizations.
- pm4py.algo.conformance.alignments.process_tree.variants.dynamic_programming.apply_list_tuple_activities(list_tuple_activities: List[Collection[str]], process_tree: ProcessTree, parameters: Dict[Any, Any] | None = None) List[Dict[str, Any]][source]#
Apply alignment to a list of trace activity tuples with memory optimization
- pm4py.algo.conformance.alignments.process_tree.variants.dynamic_programming.apply(log: DataFrame | EventLog, process_tree: ProcessTree, parameters: Dict[Any, Any] | None = None) List[Dict[str, Any]][source]#
Optimized version that aligns an event log against a process tree model. Based on the approach described in: Schwanen, Christopher T., Wied Pakusa, and Wil MP van der Aalst. “Process tree alignments.” Enterprise Design, Operations, and Computing, ser. LNCS, Cham: Springer International Publishing (2024).
- Parameters:
log – Event log or Pandas dataframe
process_tree – Process tree
parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY => the attribute to be used as activity - Parameters.SHOW_PROGRESS_BAR => shows the progress bar - Parameters.MAX_TOTAL_TIME => maximum total time in seconds - Parameters.USE_GLOBAL_CACHE => use global caching to reuse results (default: False) - Parameters.BATCH_SIZE => size of batches for processing (default: 1000) - Parameters.CLEAR_GLOBAL_CACHE => clear global cache before processing (default: True)
- Returns:
List that contains the alignment for each trace
- Return type:
aligned_traces