示例#1
0
文件: Program.cs 项目: Miltt/Console
        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;
        }
示例#2
0
文件: Program.cs 项目: Miltt/Console
        public Node CreateNode(string name)
        {            
            Node node = new Node(name);
            nodes.Add(node);

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

            return node;
        }
示例#3
0
文件: Program.cs 项目: Miltt/Console
 public Arc(int weigth, Node parent, Node child)
 {
     this.weigth = weigth;
     this.parent = parent;
     this.child = child;
 }