private PathEdge Reduce(PathEdge e, PathEdge f, int x) { return(new PathEdge(e.Other(x), f.Other(x), Union(e.xs, f.xs, x), ps[x] + e.ps + f.ps)); }
private void Add(PathEdge e) { int u = e.Either(); int v = e.Other(u); Add(u, v, e); }
/// <summary> /// Add a path-edge to the path-graph. Edges are only added to the vertex of /// lowest rank (see. constructor). /// </summary> /// <param name="edge">path edge</param> private void Add(PathEdge edge) { int u = edge.Either(); int v = edge.Other(u); if (rank[u] < rank[v]) { graph[u].Add(edge); } else { graph[v].Add(edge); } }
/// <summary> /// Create a new reduced edge from two existing edges and vertex they /// have in common. /// </summary> /// <param name="e">an edge</param> /// <param name="f">another edge</param> /// <param name="x">a common vertex</param> public ReducedEdge(PathEdge e, PathEdge f, int x) : base(e.Other(x), f.Other(x), e.xs | f.xs | 1L << x) { this.e = e; this.f = f; }
/// <summary> /// Create a new reduced edge from two existing edges and vertex they /// have in common. /// </summary> /// <param name="e">an edge</param> /// <param name="f">anOther edge</param> /// <param name="x">a common vertex</param> public ReducedEdge(PathEdge e, PathEdge f, int x) : base(e.Other(x), f.Other(x), Union(e.xs, f.xs, x)) { this.e = e; this.f = f; }