# Experimental Analyses of Temporal Activity-Sequencing Anomalies in Process Mining
## 3 Temporal Activity-Sequencing Anomaly Detection Approach
### Detection and Removal of the Temporal Activity-Sequencing Anomalies and Noises  
This section explains the approach and solution to detect and remove the temporal activity-sequencing anomalies on the process pattern graph model formed from all the temporal workcases of the event logs. The even log dataset of the ICN-based business process model attempts to explore a pair group of directed edges (A, B) on the temporal workcases, which are satisfied with the conditions of \((A\to w_{1}\,B)\) and \((B\to w_{2}\,A)\) with \(w_{1}\
eq w_{2}\); then, those pairs hold potentialities for being involved in the temporal activity-sequencing anomalies and creating noises. It is worth noting that the value \(w\) like \(w_{1}\) and \(w_{2}\) implies the number of edge occurrences. In summary, the author also encountered some meaningful findings according to which the proposed algorithmic approach still has a certain level of limitations, as follows:  
* Addressing a case of the threshold, \(T=1\), and \((A\to w_{1}\,B)\) and \((B\to w_{2}\,A)\): This case theoretically means that there ought to be a particular case where the number of directed edge occurrences between A and B is exactly same to the number of directed edge occurrences between B and A. Furthermore, this case implies that activity B's enactment is immediately followed by only activity A's enactment and vise versa, which gives the equality, \(w_{1}=w_{2}\). Conclusively, this helps us make a decision regarding whether a directed edge is a noise or not. However, the other cases of the threshold, \(T\
eq 1\), continue to escape our understanding when making decisions. At this moment, it is also necessary to have the ability to know how to distinguish the AND process pattern associations from the LOOP process pattern associations. Finally, the approach, from forming a process pattern graph model embedding those noises to disposing of said noises on the discovered process pattern graph model, is composed of the following five steps with three layers:  
1. Step 1: Discovering a process pattern graph model by amalgamating all the temporal workcases of the event log dataset and naming it Layer-1 controlled under the algorithm in [18]. 2. Step 2: From Layer-1, synthesizing all the directed edges of adjacent activities with the value \(w\) of their edge occurrences and naming it Layer-2. 3. Step 3: From Layer-2, replacing the value \(w\) by the ratio \((w\div n)\) of the edge occurrence to the total number of temporal workcases, where \(w\) is the number of edge occurrences of a corresponding pair of adjacent activities and \(n\) is the total number of temporal workcases (process instance event log traces) in the entire event log dataset. 4. Step 4: Combining all the directed edges in Layer-2 by calculating the ratio \((b\div a)\) of one directed edge occurrence ratio to the other directed edge occurrence ratio in a corresponding pair of adjacent activities and finally naming it Layer-3. 5. Step 5: Setting the \(T\)-filter threshold, removing all the directed edges higher than the \(T\)-value in Layer-3, updating the corresponding values on Layer-1, and obtaining the result. Algorithm 1 describes our algorithmic approach for detecting and removing the temporal activity-sequencing anomalies and their noises, in detail. It uses the GetGraphFromLog function in this algorithm, which is an updated version of the removePhantomEdge function and the GetTWTNetwork function in the SICN (structured information control net)-based process-mining framework [11] and the human-centered workflow intelligence framework [27], respectively. The authors' research group was able to successfully develop a much more sound process-mining framework and system through this algorithmic approach. It is worth noting that the author will not describe the details of this algorithmic approach in order to focus on the experimental analyses of this paper's scope and main goal.