add graph traversal
refactor graphtraversal