## 2 Results and Discussion  
### Description of problem and assessment of problem size  
We are looking for matches between the query set of atomic Cartesian coordinates \(\textbf{x}_{i}\,i=1,\ldots,m\) and atom types \(s_{i}\), with corresponding structures in a database of three-dimensional molecular structures numbered \(j=1,\ldots,N\), where the \(j\)th molecular structure in the database has atomic Cartesian coordinates \(\textbf{y}_{jk}\,k=1,\ldots,n_{j}\) and atom types \(t_{jk}\). The number \(\tau\) of atom types is limited, e.g. \"atoms\" may be centers of amino-acid residues of 20 types, or real atoms with types corresponding to chemical elements, or atoms with certain property types (charged, polar, neutral, etc.).  
A _full match_, or, for brevity, a _match_ of the query in molecule \(j\) is defined as an assignment of all \(m\) coordinates \(\textbf{x}_{i}\) of the query to \(m\) coordinates \(\textbf{y}_{ji}\) of molecule \(j\) so that \(\forall i\in\{1,\ldots,m\}:s_{i}=t_{ji}\) (if needed the \(t_{i}\) are renumbered). It is possible that several matches exist in the same molecule and it is likely that many matches can be found in the database. An _optimal match_ is defined as a match for which the RMSD \(R=\sqrt{\frac{1}{m}\sum_{i=1}^{m}\left(\mathbf{x}_{i}-\mathbf{y}_{ji}\right)^{2}}\) is minimal. We are interested mainly in optimal or near-optimal matches because in these cases the physico-chemical properties of the query and the matching epitope promise to be similar.  
For the estimation of the problem complexity it is realistic to assume that the number of atoms \(q_{i}\) of any type \(i=1,\ldots,\tau\) in the query is smaller than the number of atoms \(M_{i}\) of the corresponding types \(i=1,\ldots,\tau\), since epitopes typically contain much less atoms than the molecules in the database. The theoretical number \(\Theta\) of matches of a query in a database of \(N\) molecules is then  
\[\Theta=\sum_{j=1}^{N}\prod_{i=1}^{\tau}\frac{M_{ji}!}{(M_{ji}-q_{i})!}. \tag{1}\]  
To assess a realistic size of \(\Theta\) we take the medium sized protein molecule human hemoglobin as a database representative. As atoms we use \(C_{\alpha}\) atoms, and atoms may have one type out of \(\tau=4\), namely _hydrophobic_, _polar_, _positive_, or _negative_, depending on electric charge and solubility in water. As an example for a query epitope we use the heme binding pocket, also in human hemoglobin, formed by 16 residues, including \(q_{1}=12\) hydrophobic, \(q_{2}=3\) polar, \(q_{3}=1\) positive, and \(q_{4}=0\) negative residues. Since it is known that there are four similar heme binding pockets in hemoglobin, the search for optimal and near-optimal matches with the query pocket should result in four matches. The whole human hemoglobin molecule contains 574 amino acid residues, including \(M_{1}=276\) hydrophobic, \(M_{2}=188\) polar, \(M_{3}=56\) positive, and \(M_{4}=54\) negative residues. The product in Equation 1 then amounts to about \(10^{38}\), which means that taking into account the structure of human hemoglobin alone, the four optimal and near-optimal matches form a minute fraction of all theoretical matches. Moreover, with the number \(N\) of relevant molecules in the Protein Data Bank being of the order of \(10^{4}\), we have \(\Theta\approx 10^{42}\). This number makes it clear that a complete enumeration of all possible matches in search for optimal matches is not feasible. We therefore have devised the following EpitopeMatch algorithm.