and can be solved with polynomial scaling, e.g., using the so-called Hungarian method. The auxiliary connectivity matrices A and B only include information about direct neighbours, i.e. the first coordination sphere denoted with A and B in the following. To include more information about the chemical environment, we can count bonds in higher coordination spheres such that the auxiliary problem becomes