## 4 Implementation of the Extended Algorithm
### Discovering Meta-States  
In this subsection, we introduce an approach for process model abstraction and simplification. Simplification of the process models can be done not only by node and edge filtering, but also by event aggregation. In [27], the authors proposed such model abstraction by iteratively aggregating highly correlated (in the context sense) but less significant nodes. However, in some fields, e.g., healthcare, it makes sense to propose a different method of abstraction. It is very likely that cycles present in the model, and this can signify distinct process parts from the perspective of for whom the process is performed. In healthcare, the cycles may represent routine procedures or repeated medical events for patients, i.e., an objective being in some stage of process execution or a \"meta-state\". We clarify how meta-states are identified in an event log via pseudocode below (Algorithm 1). We assume a simple cycle to be a meta-state if the probability of its occurrence in the log exceeds a specified threshold, i.e., a cycle significance, as in the case of activities and their corresponding relations filtration (see Algorithm 2). One can obtain new knowledge about process execution by distinguishing the most significant cyclic behavior and exceptions. ```
procedureCyclesSearch(Log) Input: \"Flat\" event log Log composed of process cases Output: Set of (simple) cycles cycles found in event log Log, Absolute abs[\(c\)] and case \(\text{ese}[c]\) frequencies of each cycle \(c\in\text{cycles}\) cycles cycles \(\leftarrow\)[] k \(\leftarrow\)0 for all cases \(t\in\text{Log}\)do for all unique activities \(n\in\text{t}\)do  case_cycles \(\leftarrow\)[] \(i\)\(\leftarrow\)0 \(j\)\(\leftarrow\)0 while\(i\)\(<\)length of \(t\)do if\(t[i]=n\)then  case_cycles[j] \(\leftarrow\)\(i\)// Positions of activity \(n\) in case t  j \(\leftarrow\)\(j+1\) endif \(i\)\(\leftarrow\)\(i+1\) endwhile \(i\)\(\leftarrow\)\(0\) while\(i+1<\)length of case_cycles do  c \(\leftarrow\)\(t[\)from case_cycles[\(i\)] to case_cycles[\(i+1\)] \(-1\)] // Part of case \(t\) that starts and ends with activity \(n\) if length of \(c\) = number of unique activities \(a\in c\)then if\(c\
otin\text{Cycles}\)then  cycles[k] \(\leftarrow\)\(c\)  abs[\(c\)] \(\leftarrow\)\(0\) \(k\gets k+1\) endif  abs[\(c\)] \(\leftarrow\) abs[\(c\)] + 1  case[\(c\)] \(\leftarrow\)\(\text{ese}[c\)] + 1 // if \(c\) was not found earlier within a case \(t\) endif endwhile endfor endfor endprocedure
```  
**  
```
procedureFindStates(Cycles, CycleFrequencies, NumberOfCases, MetaStateSignificance) Input: Set of (simple) cycles Cycles found in a process model by DFS;  Case \(\text{\rm cse}[c]\in\text{\rm CycleFrequencies frequency of each cycle }c\in\text{\rm Cycles}\);  Number of cases NumberOfCases in an event log;  Required significance of cycle MetaStateSignificance to be defined as meta-state Output: Set of meta-states (significant cycles) MetaStates for all cycles \(c\in\text{\rm Cycles}\)do iflength of \(c>1\)then if\(\text{\rm cse}[c]/\text{\rm NumberOfCases }\geq\text{\rm MetaStateSignificance then  MetaStates }\leftarrow\text{\rm ADD}(c)\) endif endif endfor endprocedure
```  
**Algorithm 2** Identification of significant cycles (meta-states) in an event log. We propose two types of aggregation. In the first type, nodes included in meta-states are allowed to be present distinctly in a process model. We call this aggregation \"outer\" aggregation. In contrast, \"inner\" aggregation redirects all relationships of single events to corresponding meta-states. Here, we obtain different ways of redirecting relations: to all meta-states that contain such an event or to the most frequent one. According to notations proposed in the previous subsection, we give a formal description of model aggregation.