pm4py.algo.conformance.alignments.process_tree.variants.milp 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

class pm4py.algo.conformance.alignments.process_tree.variants.milp.Parameters(*values)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
SHOW_PROGRESS_BAR = 'show_progress_bar'#
class pm4py.algo.conformance.alignments.process_tree.variants.milp.ProcessTreeAligner(tree: ProcessTree)[source]#

Bases: object

Implementation of 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).

align(trace: Tuple[str]) → Tuple[float, List[Tuple[str, str]]][source]#

Align a trace with the process tree. Using tuple for trace to enable caching.

Args:

trace: A tuple of activity labels (converted from list for caching)

Returns:

A tuple containing (alignment cost, alignment moves)

pm4py.algo.conformance.alignments.process_tree.variants.milp.apply_list_tuple_activities(list_tuple_activities: List[Collection[str]], aligner: ProcessTreeAligner, parameters: Dict[Any, Any] | None = None) → List[Dict[str, Any]][source]#

Apply the alignment algorithm to a list of activities. Optimized to use caching and more efficient data structures.

pm4py.algo.conformance.alignments.process_tree.variants.milp.apply(log: DataFrame | EventLog, process_tree: ProcessTree, parameters: Dict[Any, Any] | None = None) → List[Dict[str, Any]][source]#

Aligns an event log against a process tree model, using 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

Returns:

List that contains the alignment for each trace

Return type:

aligned_traces