change the direction of the node should be visited.