Distinguishing the topology of macrocyclic compounds and catenanes