The application of pattern-recognition techniques to the problem of separating reaction mechanisms in high-multiplicity collisions is explored. The "distance analysis," which we motivate and explain here, is an algorithm for finding the most densely populated regions of the multidimensional phase space. It provides a sensitive and model-independent means of identifying the individual events which make up each of the regions. It is then possible to use other techniques to interpret these. This procedure could also be useful outside particle physics. It is very simple and fast, and a detailed account of its implementation is given. As examples, we analyze the reactions ${K}^{\ensuremath{-}}p\ensuremath{\rightarrow}{K}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}p$ and ${K}^{\ensuremath{-}}p\ensuremath{\rightarrow}{K}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}p{\ensuremath{\pi}}^{0}$ at 12.6 GeV/c.