pm4py.objects.process_tree.utils.struct_similarity 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.process_tree.utils.struct_similarity.features_from_process_tree(tree: ProcessTree) → ndarray[source]#
Parameters:

tree (pm4py.objects.process_tree.obj.ProcessTree)

Returns:

Components in the order defined by FEATURES.

Return type:

numpy.ndarray (len = 10)

pm4py.objects.process_tree.utils.struct_similarity.structural_distance(tree1: ProcessTree, tree2: ProcessTree, weights: Dict[str, float] = None) → float[source]#

Euclidean distance of the normalised feature vectors. weights lets you emphasise certain dimensions (defaults = 1).

pm4py.objects.process_tree.utils.struct_similarity.structural_similarity(tree1: ProcessTree, tree2: ProcessTree, weights: Dict[str, float] = None) → float[source]#

Computes the structural similarity between two process trees, following an approach similar to:

Yan, Z., Dijkman, R., & Grefen, P. (2012). Fast business process similarity search. Distributed and Parallel Databases, 30(2), 105–144. (https://doi.org/10.1007/s10619-012-7089-z)

Parameters:
  • tree1 – First process tree

  • tree2 – Second process tree

  • weights – Weights of each feature

Returns:

Similarity metric

Return type:

sim_metric