      "        node = Node(id)\n",
      "        self.nodes[id] = node\n",
      "        return node\n",
      "\n",
      "    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"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 2,
 
</s> remove     def add_edge(self, source, dest, weight=0):
        if source not in self.nodes:
            self.add_node(source)
        if dest not in self.nodes:
            self.add_node(dest)
        self.nodes[source].adjacent[self.nodes[dest]] = weight </s> add  </s> remove     "        self.nodes = OrderedDict()  # key = node id, val = node\n",
 </s> add     "        self.nodes = {}  # key = node id, val = node\n", </s> remove     "        self.nodes = OrderedDict()  # key = node id, val = node\n",
 </s> add     "        self.nodes = {}  # key = node id, val = node\n",
    "    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)"
      "        node = Node(id)\n",
      "        self.nodes[id] = node\n",
      "        return node\n",
      "\n",
    "    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)"
    "    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)"
    "    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)"
    "    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)"
    "    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)"
    "    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)"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 2,
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Rework graph challenge and solution (#86) 
graphs_trees/graph/graph_solution.ipynb