Computational Intelligence and Neuroscience / 2021 / Article / Alg 3

Research Article

An Efficient Automatic Gait Anomaly Detection Method Based on Semisupervised Clustering

Algorithm 3

The pseudocodes of the pairwise constraint generating.
Algorithm: PAIRWISE-CONSTRAINTS-GENERATING
Input: Disjoint λ sets of data points with preassigned class labels
Output: must-link constraints ML and cannot-link constraints CL.
Method:
1. ML = Ø, CL = Ø
2. For i = 1 to λ
  ML = ML ∪ {Qi × Qi}, where × is the Cartesian product operator.
3. For i = 1 to λ − 1
  For j = j + 1 to λ
   CL = CL ∪ {Qi × Qj}.