use size_t for idx_t
add a timing test
avoid allocation of nodes if already in visited