Skip to main content
. 2021 Feb 25;7:e366. doi: 10.7717/peerj-cs.366

Algorithm 1. Initial Clustering.

1: procedure INITIALCLUSTER G = (V, E), σ12, C a number of initial clusters)
2:  Compute a shortest path between any u, vV.
3:  Choose C nodes uniformly at random, assign one label to each.
  ⊳ Each node is a starting point for a cluster.
4:  while some nodes are still unlabeled do
5:   for every cluster do
6:    Find neighbors of nodes in the given cluster.
7:    if there are unlabeled neighbors or labeled neighbors with a worse distance to another
 cluster then
    ⊳ Keep only the first condition for a fast run.
8:    Add the neighbor whose addition minimizes the within-cluster evaluation function H^σI2.