      "    def test_graph(self):\n",
      "        graph = Graph()\n",
      "        for id in range(0, 6):\n",
      "            graph.add_node(id)\n",
      "        graph.add_edge(0, 1, 5)\n",
      "        graph.add_edge(0, 5, 2)\n",
      "        graph.add_edge(1, 2, 3)\n",
      "        graph.add_edge(2, 3, 4)\n",
      "        graph.add_edge(3, 4, 5)\n",
      "        graph.add_edge(3, 5, 6)\n",
      "        graph.add_edge(4, 0, 7)\n",
      "        graph.add_edge(5, 4, 8)\n",
      "        graph.add_edge(5, 2, 9)\n",
      "\n",
      "        assert_equal(graph.nodes[0].adjacent[graph.nodes[1]], 5)\n",
      "        assert_equal(graph.nodes[0].adjacent[graph.nodes[5]], 2)\n",
      "        assert_equal(graph.nodes[1].adjacent[graph.nodes[2]], 3)\n",
      "        assert_equal(graph.nodes[2].adjacent[graph.nodes[3]], 4)\n",
 
</s> remove     "        graph.add_edge(0, 1, 5)\n",
    "        graph.add_edge(0, 5, 2)\n",
    "        graph.add_edge(1, 2, 3)\n",
    "        graph.add_edge(2, 3, 4)\n",
    "        graph.add_edge(3, 4, 5)\n",
    "        graph.add_edge(3, 5, 6)\n",
    "        graph.add_edge(4, 0, 7)\n",
    "        graph.add_edge(5, 4, 8)\n",
    "        graph.add_edge(5, 2, 9)\n",
 </s> add     "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n", </s> remove     "    def test_graph(self):\n",
 </s> add     "    def create_graph(self):\n", </s> remove     "    def test_graph(self):\n",
 </s> add     "    def create_graph(self):\n", </s> remove         graph.add_edge(0, 1, 5)
        graph.add_edge(0, 5, 2)
        graph.add_edge(1, 2, 3)
        graph.add_edge(2, 3, 4)
        graph.add_edge(3, 4, 5)
        graph.add_edge(3, 5, 6)
        graph.add_edge(4, 0, 7)
        graph.add_edge(5, 4, 8)
        graph.add_edge(5, 2, 9)
 </s> add         return graph

    def test_graph(self):
        graph = self.create_graph()

        graph.add_edge(0, 1, weight=5)
        graph.add_edge(0, 5, weight=2)
        graph.add_edge(1, 2, weight=3)
        graph.add_edge(2, 3, weight=4)
        graph.add_edge(3, 4, weight=5)
        graph.add_edge(3, 5, weight=6)
        graph.add_edge(4, 0, weight=7)
        graph.add_edge(5, 4, weight=8)
        graph.add_edge(5, 2, weight=9) </s> remove     "    def add_edge(self, source, dest, weight=0):\n",
    "        if source not in self.nodes:\n",
    "            self.add_node(source)\n",
    "        if dest not in self.nodes:\n",
    "            self.add_node(dest)\n",
    "        self.nodes[source].adjacent[self.nodes[dest]] = weight"
 </s> add     "    def add_edge(self, id_source, id_dest, weight=0):\n",
    "        if id_source not in self.nodes:\n",
    "            self.add_node(id_source)\n",
    "        if id_dest not in self.nodes:\n",
    "            self.add_node(id_dest)\n",
    "        self.nodes[id_source].add_neighbor(self.nodes[id_dest], weight)\n",
    "\n",
    "    def add_undirected_edge(self, source, dest, weight=0):\n",
    "        self.add_edge(source, dest, weight)\n",
    "        self.nodes[dest].add_neighbor(self.nodes[source], weight)"
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
      "    def test_graph(self):\n",
      "        graph = Graph()\n",
      "        for id in range(0, 6):\n",
      "            graph.add_node(id)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
    "        return graph\n",
    "\n",
    "    def test_graph(self):\n",
    "        graph = self.create_graph()\n",
    "\n",
    "        graph.add_edge(0, 1, weight=5)\n",
    "        graph.add_edge(0, 5, weight=2)\n",
    "        graph.add_edge(1, 2, weight=3)\n",
    "        graph.add_edge(2, 3, weight=4)\n",
    "        graph.add_edge(3, 4, weight=5)\n",
    "        graph.add_edge(3, 5, weight=6)\n",
    "        graph.add_edge(4, 0, weight=7)\n",
    "        graph.add_edge(5, 4, weight=8)\n",
    "        graph.add_edge(5, 2, weight=9)\n",
      "\n",
      "        assert_equal(graph.nodes[0].adjacent[graph.nodes[1]], 5)\n",
      "        assert_equal(graph.nodes[0].adjacent[graph.nodes[5]], 2)\n",
      "        assert_equal(graph.nodes[1].adjacent[graph.nodes[2]], 3)\n",
      "        assert_equal(graph.nodes[2].adjacent[graph.nodes[3]], 4)\n",
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Rework graph challenge and solution (#86) 
graphs_trees/graph/graph_challenge.ipynb