We present the Generalized Root Mean Square Deviation (G-RMSD) method. G-RMSD is an optimization method to calculate the minimal RMSD value of two atomic structures by optimal superimposition. G-RMSD is not restricted to systems with an equal number of atoms to compare or a unique atom mapping between two molecules. The method can handle any type of chemical structures, including transition states and structures which cannot be explained only with valence bond (VB) theory (non-VB structures). It requires only Cartesian coordinates for the structures. Further information, i.e. atom- and bond types can also be included. Applications of G-RMSD to the classification of α-D-glucose conformers and 3D partial structure search using a dataset containing equilibrium (EQ), dissociation channel (DC), and transition state (TS) structures are demonstrated. We find that G-RMSD allows for a successful classification and mapping for a wide variety of molecular structures.