def __init__(self, nodes: list[Node], title='', draw_edges=True) -> None:
    (self.fig, self.ax) = plt.subplots()
    plt.title(title)
    plt.tight_layout()
    self.ax.set_aspect('equal')
    self.i = True
    if draw_edges:
        edges = {tuple(sorted((n.id, x))) for n in nodes for x in n.neighbours}
        for edge in edges:
            (from_node, to_node) = [nodes[x] for x in edge]
            x = [n.x for n in (from_node, to_node)]
            y = [n.y for n in (from_node, to_node)]
            plt.plot(x, y, color='gray', linewidth=0.5)
    (x, y) = ([n.x for n in nodes], [n.y for n in nodes])
    self.ax.scatter = plt.scatter(x, y, c=[0 for _ in range(len(x))], s=(([30] + ([10] * (len(nodes) - 2))) + [30]), vmin=0, vmax=3, cmap=matplotlib.colors.ListedColormap(['grey', 'springgreen', 'red', 'white']))
    self._colors = self.ax.scatter.get_array()
    for n in nodes:
        if (not n.neighbours):
            self._colors[n.id] = 3
def __init__(self, nodes: list[Node], title=, draw_edges=True) -> None:
    (self.fig, self.ax) = plt.subplots()
    plt.title(title)
    plt.tight_layout()
    self.ax.set_aspect('equal')
    self.i = True
    if draw_edges:
        edges = {tuple(sorted((n.id, x))) for n in nodes for x in n.neighbours}
        for edge in edges:
            (from_node, to_node) = [nodes[x] for x in edge]
            x = [n.x for n in (from_node, to_node)]
            y = [n.y for n in (from_node, to_node)]
            plt.plot(x, y, color='gray', linewidth=0.5)
    (x, y) = ([n.x for n in nodes], [n.y for n in nodes])
    self.ax.scatter = plt.scatter(x, y, c=[0 for _ in range(len(x))], s=(([30] + ([10] * (len(nodes) - 2))) + [30]), vmin=0, vmax=3, cmap=matplotlib.colors.ListedColormap(['grey', 'springgreen', 'red', 'white']))
    self._colors = self.ax.scatter.get_array()
    for n in nodes:
        if (not n.neighbours):
            self._colors[n.id] = 3