SimpleBFS and SimpleDFS unified.