Skip to main content
. 2022 Sep 15;22(18):6980. doi: 10.3390/s22186980
Algorithm 4 calculate_rules
Input:  adj_mat
Output:  rules
  •    1:

    rules[]

  •    2:

    Generate directed graph from adj_mat

  •    3:

    Remove edges with weight < min_rule_perc

  •    4:

    Get connected components of the graph

  •    5:

    for all  connected_componentconnected_components do

  •    6:

        if  size(connected_component)>1 then

  •    7:

           Sort nodes of the connected component graph by time

  •    8:

           Append the nodes to rules

  •    9:

        end if

  •  10:

    end for

  •  11:

    return  rules