public void addNeighbor(Node node) { if (!neighbors.Contains(node)) { neighbors.Add(node); } }
public void removeNeighbor(Node node) { if (node != null) { while (neighbors.Contains(node)) { neighbors.Remove(node); } } }
public Edge(Node node1, Node node2) { this.node1 = node1; this.node2 = node2; }