Utility for substructure matching.