added some graph-theoretic methods to Match