Esempio n. 1
0
        public Node AddArc(Node child, int weigth)
        {
            arcs.Add(new Arc(weigth, this, child));                

            if (!child.arcs.Exists(a => a.parent == child && a.child == this))
            {
                child.AddArc(this, weigth);
            }

            return this;
        }
Esempio n. 2
0
        public Node CreateNode(string name)
        {            
            Node node = new Node(name);
            nodes.Add(node);

            if (root == null)
            {
                root = node;
            }

            return node;
        }
Esempio n. 3
0
 public Arc(int weigth, Node parent, Node child)
 {
     this.weigth = weigth;
     this.parent = parent;
     this.child = child;
 }