Skip to content

visited [terminology]

Terminology

Usage

  • Use for graph vertices or grid cells already processed by a traversal.
  • It expresses traversal state more precisely than seen.
  • Keep it when revisiting a node would repeat DFS or BFS work.
visited = [False] * n

def dfs(city):
    visited[city] = True