Add duplicate filtering to graph class