## 3 Chaotic Activity Filtering Approach Based on Direct Following Relationship
### Direct Chaotic Activity Filtering  
Algorithm 1 describes an algorithm that uses an iterative approach to filter chaotic activity. The algorithm generates a list of event logs and takes the original event log as the starting element of the list. Each component in the queue includes a filtered version of \(L\), and compared with the previous element, each subsequent component of the queue has supplementary activities filtered out. The process of the algorithm proposed in this section is as follows: firstly, the relation between activities in the log is extracted from the input event log to form a relationship table, and then the relation table is used to count the statistics of the relation between activities to determine which activities are chaotic activities. Generally speaking, chaotic activities have no clear position in the log, and the direct following relationship between chaotic activities and other activities is disordered. Therefore, in the event log, the direct following relationship and direct preceding relationship between chaotic activities and other activities are confusing, i.e., chaotic activities and most activities in the log have different following relations. Therefore, we can obtain the corresponding activity set that meets the following conditions by counting the different follows relations between activities, and calculate the chaos degree of the activities through the obtained activity set, and judge whether the activities are chaotic according to the chaos degree of the activities. Define the chaos degree of activity \(y\in ActSet(L)\) in the log for the \(i\)-th condition as \(CHi(y)\). The program code is as follows:  
**Condition (1):** The degree of activity disorder is represented by the sum of the number of direct following relationships and the number of direct preceding relationships that exist between an activity and all other activities in the log, that is, for activity \(p\), let the log be \(L\), and the total of the number of elements in set \(S_{1}\) and \(S_{2}\) be counted as the degree of chaos in activity \(p\). If the chaotic degree of activity \(p\) exceeds the set threshold, it is judged that \(p\) is a candidate chaotic activity. \[S_{1}=\left\{q\middle|\forall_{q\in ActSet(L)}\#(<p,q>,L)\ >0\right\}\text{, }S_{2}= \left\{q\middle|\forall_{q\in ActSet(L)}\#(<q,p>,L)\ >0\right\}\]  
Take the log \(L=\left[\text{<}a\text{,}b\text{,}c\text{,}d\text{,}x\text{>}^{10}\text{,}c \text{,}a\text{,}b\text{,}x\text{,}c\text{,}d\text{>}^{10}\text{,}c\text{,}a \text{,}x\text{,}b\text{,}c\text{,}d\text{>}^{10}\text{,}\text{,}a\text{,}x \text{,}b\text{,}c\text{,}d\text{>}^{10}\text{]}\) as an example, and Table 1 is used to calculate for activity \(x\). First of all, for activity \(x\), find the activities that have a direct following relationship with \(x\) in the relation table, and find that the values of #(<\(x\),\(b\)>,\(L\)), #(<\(x\),\(c\)>,\(L\)) and #(<\(x\),\(d\)>,\(L\)) are all greater than 0, so the set of activities that have a direct following relationship with \(x\) is {\(b\),\(c\),\(d\)}, and the number of elements in the set is 3. Secondly, for activity \(x\), find the activities that have a direct preceding relationship with \(x\) in the relation table, and find that the values of #(<\(a\),\(x\)>,\(L\)), #(<\(b\),\(x\)>,\(L\)), #(<\(c\),\(x\)>,\(L\)) and #(<\(d\),\(x\)>,\(L\)) are all greater than 0, so the set of activities that have a direct following relationship with \(x\) is {\(a\),\(b\),\(c\),\(d\)}, and the number of elements in the set is 4. So for activity \(x\)the collection of activities that satisfy the conditions is \(\{b,c,d\}\) and \(\{a,b,c,d\}\). The sum of the number of elements in the two sets is calculated, and the result is 7, so \(CH_{1}(x)=7\) is obtained. This calculation is performed for all activities in the log, and the corresponding results of each activity are obtained, and the average value of all results is obtained. In this log, the average value is 5.