findEdges() written using itertools.combinations