This should be updated so that it returns a subset of edges, rather than the slightly strange matching it currently produces.