The algorithm chooses the winning unit by comparing the current input pattern against the weight vector of each of the output units. The one that is closest wins. That is, unit i wins if:
|wi - p| < |wj - p| for all j
where wj is the weight vector of the jth unit and p is the current input vector.