Пример #1
0
        UndirectedEdge Connect(Node other, string type)
        {
            UndirectedEdge _edge = new UndirectedEdge(type, this, other);

            edges.Add(_edge);
            other.edges.Add(_edge);
            return(_edge);
        }
Пример #2
0
        UndirectedEdge Connect(Node aNode, string type, Node bNode)
        {
            ensureContainment(aNode);
            ensureContainment(bNode);
            UndirectedEdge _edge = aNode.Connect(bNode, type);

            if (!edges.Contains(_edge))
            {
                edges.Add(_edge);
            }
            return(_edge);
        }