Using unordered set for visitedPairs instead of set

Signed-off-by: Evan Driscoll <driscoll@cs.wisc.edu>