Fix to minimum distance finder for nodes in a chemgraph.