At each step, the algorithm finds the pair of labels that is currently the closest together according to the distance metrics of Equations (1) and (2), combines those two labels into a new one, and updates the set of P (s | t) and P (t | s) values appropriately.
the choice of label pair to collapse in each iteration can be expressed formally as arg min either a source label pair or a target label pair may be chosen by the algorithm in each iteration.