Skip to content

Inductive Miner: the strict sequence cut and the every-pair test (Leemans 2017) - #62

Merged
s4mstruthers merged 1 commit into
mainfrom
fix/strict-sequence-cut
Oct 13, 2026
Merged

s4mstruthers merged 1 commit into
mainfrom
fix/strict-sequence-cut

Conversation

@s4mstruthers

Copy link
Copy Markdown
Owner

What changed

Two corrections to the Inductive Miner's sequence cut (openprocess/mining/discovery/inductive.py), both taken from S.J.J. Leemans, Robust Process Mining with Guarantees (PhD thesis, TU/e 2017), which is what ProM's and PM4Py's implementations follow:

  1. The every-pair test (maximal_sequence_cut, thesis p. 188). The definition of a sequence cut requires that every activity of an earlier group reaches every activity of a later group, and none reaches back. The old code merged groups and validated the cut with an any-pair test, so it accepted {b} | {a, c} | {d} for [<b,b,c,c,c,c>, <b,a,d,d>] although c reaches nothing; the definition gives {b} | {a, c, d}. Now computed as the thesis does: one group per activity, merge any two that hold a pair that reaches both ways or neither way, until nothing merges, then order by reachability and validate every pair.
  2. The strict sequence cut (merge_skippable_groups, thesis p. 233). After the maximal cut, a group that some trace gets past without visiting absorbs the neighbouring groups that can only be entered through it or only leave through it, so an optional stretch is one skippable block: [<b>^4, <b,b,a,c>] gives →(↺(b,τ), ×(τ, →(a,c))) instead of →(↺(b,τ), ×(τ,a), ×(τ,c)), which also allowed <b,a> and <b,c>.

Around it: the How tab shows a line under a sequence cut when the strict step merged groups; the thesis is a reference on the IM topic (references.py, docs/references.md regenerated), so Cite on the box lists it; the module docstring explains the strict step; two tests pin the two examples and check the textbook log is unchanged; tests/cross_check_inductive_miner.py records both baselines; CHANGELOG under 0.11.2.

Effect

Cross-check against PM4Py 2.7.23 (seed 2026, 6 textbook + 400 random logs):

identical trees differ of which less precise guarantees hold
before 369 / 406 37 30 406 / 406
after 401 / 406 5 2 406 / 406

Three other seeds (300 random logs each): 302, 301 and 303 identical. The remaining differences are all fall-throughs on logs that have no cut at all, where the two implementations try the fall-throughs in a different order; precision is equal or goes either way.

This changes discovered models wherever a log has a skippable stretch. The textbook logs and every existing test expectation are unchanged. A saved analysis with such a log will show "This run differs from the record" after the update, which is the badge doing its job.

Checked

🤖 Generated with Claude Code

https://claude.ai/code/session_01CxRhDznFAbwU3x78bugqqR


Generated by Claude Code

…om Leemans 2017

The sequence cut accepted a partition when some pair of activities reached
across it; the definition requires every pair. And the maximal cut made
each optional stretch skippable on its own, ×(τ,a), ×(τ,c), where the
strict sequence cut of Leemans' thesis (p. 233), which ProM and PM4Py
follow, merges groups that can only be skipped together into ×(τ, →(a,c)).
Both are implemented as the thesis has them; the How tab says when the
strict step merged groups; the thesis is a reference on the IM topic, so
Cite lists it. Two tests pin the two examples; the cross-check against
PM4Py goes from 369 identical trees of 406 to 401, the guarantees holding
on every log, and its docstring records both baselines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CxRhDznFAbwU3x78bugqqR
@s4mstruthers
s4mstruthers merged commit f89ce32 into main Oct 13, 2026
7 checks passed
@s4mstruthers
s4mstruthers deleted the fix/strict-sequence-cut branch October 13, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant