Inspired by Minimum Spanning Tree [1]}, we propose the LFF generator to build the leader-follower relationship between agents.
First, we initialise an adjacency matrix \(w^a\)  and add the root node of the greatest \(\rho _i\)  to a new set \(N_{new}\) .
Next, we choose a candidate node \(i\)  has the edge of the maximum flow value \(w_{ir}\) , where \(i\in \left(N\backslash N_{new}\right)\)  and \(r\in N_{new}\) .
The candidate node will be included to \(N_{new}\)  if \(w_{ir}\)  is greater than any flow value outgoing from it. Meanwhile, the directed edge \(e_{ir}\)  will be recorded.
Otherwise, it indicates that there are no suitable leaders for the candidate node in \(N_{new}\) , and then we reject this node and construct another tree based on \(\rho _i\) .
We repeat the processes until all agents are included in \(N_{new}\)  and finally obtain the leader-follower relationship \(w^f\) .
Alternatively, if the number of groups is given, we choose top \(k\)  nodes in terms of \(\rho _i\)  as root nodes in the first step to simplify the forest architecture, which is called Top(k)
selection. Note that the rejection mechanism is disabled in this case. The details of the LFF generator is shown in Algorithm REF .
