public virtual Graph.Node AddEdge(Graph.Node to, string info) { Graph.Edge e = new Graph.Edge(this, this, to, info); this.outs.AddItem(e); to.ins.AddItem(e); return(this); }
public virtual bool SameAs(Graph.Edge rhs) { if (this.from == rhs.from && this.to == rhs.to) { return(true); } return(false); }
public static IList <Graph.Edge> CombineEdges(IList <Graph.Edge> edges) { IList <Graph.Edge> ret = new AList <Graph.Edge>(); foreach (Graph.Edge edge in edges) { bool found = false; for (int i = 0; i < ret.Count; i++) { Graph.Edge current = ret[i]; if (edge.SameAs(current)) { ret.Set(i, current.Combine(edge)); found = true; break; } } if (!found) { ret.AddItem(edge); } } return(ret); }
public virtual Graph.Edge Combine(Graph.Edge rhs) { string newlabel = this.label + "," + rhs.label; return(new Graph.Edge(this, this.from, this.to, newlabel)); }