The atom mapping is a well-known problem of growing importance in reaction classification and automatized synthesis planning and is closely related to the graph isomorphism problem. In this context, isomorphism can be understood as a structure-preserving bijection between two graphs, i.e. two different graphs are isomorphic if they have the same number of edges, vertices, and the same connectivity of the edges. Whether such a graph isomorphism is determinable in polynomial time is an unsolved problem, known as the graph isomorphism problem. While there is an extensive range of atom mapping algorithms, most of these algorithms are based on molecular graphs as the orientation of atoms (e.g., of the hydrogen atoms within a methyl group) is not crucial for the applications mentioned above. For the example of the methyl group, a misassignment of the hydrogen atoms may lead to misassignments of the corresponding molecular orbitals localized on these atoms. Hence, the orbital map would be erroneous. This becomes relevant if the σ C-H -like localized orbitals of the methyl group differ due to electronic effects. Incorporating the orientation in the atom mapping procedure is addressed, for instance, in Ref. 34 for protein-ligand docking by using the root mean square deviation of atomic positions. Another way to account for the orientation is to use dihedral angles, which will be subject of the atom mapping algorithm proposed in this work. Unlike most applications of atom mapping algorithms, errors in the atom maps can be tolerated in the sense that they may slightly increase the computational cost, but still ensure a high accuracy: they may lead to errors in the orbital maps, but these errors are expected to be compensated in the prescreening procedure. Here, an atom mapping algorithm is presented that focuses on the number of formed and broken bonds as a measure for the number of electrons redistributed during the reaction, known as the principle of minimum chemical distance, and the dihedral angles in order to automatize the partitioning of orbital pairs. Within this algorithm, linear assignment problems are solved with the so-called Hungarian method. This allows to consider the orbital mapping also as such a problem and to solve it analogously.