Implementing an implicit graph traversal algorithm