      "%%writefile graph.py\n",
      "from collections import OrderedDict\n",
      "\n",
      "\n",
      "class Node:\n",
      "\n",
      "    def __init__(self, id):\n",
 
</s> remove         self.visited = False
 </s> add         self.visit_state = State.unvisited </s> remove     "        self.visited = False\n",
 </s> add     "        self.visit_state = State.unvisited\n",
    "from enum import Enum  # Python 2 users: Run pip install enum34\n",
    "\n",
    "\n",
    "class State(Enum):\n",
    "    unvisited = 1\n",
    "    visited = 2\n",
    "    visiting = 3\n",
      "%%writefile graph.py\n",
      "from collections import OrderedDict\n",
    "from enum import Enum  # Python 2 users: Run pip install enum34\n",
    "\n",
    "\n",
    "class State(Enum):\n",
    "    unvisited = 1\n",
    "    visited = 2\n",
    "    visiting = 3\n",
      "\n",
      "\n",
      "class Node:\n",
      "\n",
      "    def __init__(self, id):\n",
keep add keep keep keep keep keep
 Added three state variable visit_state which will be useful for more advanced challenges such as topological sort. 
graphs_trees/graph/graph_solution.ipynb