コード例 #1
0
        public void Contract(Edge edge)
        {
            var toRemove =
                Edges.Where(
                    e =>
                    e == edge || (e.Left == edge.Left && e.Right == edge.Right) ||
                    (e.Left == edge.Right && e.Right == edge.Left)).ToArray();

            foreach (var item in toRemove) Edges.Remove(item);

            Nodes.Remove(edge.Right);

            var toMove = Edges.Where(e => e.Left == edge.Right || e.Right == edge.Right);
            foreach (var item in toMove)
            {
                if (item.Right == edge.Right) item.Right = edge.Left;
                else item.Left = edge.Left;
            }
        }
コード例 #2
0
 public void Contract(Edge edge)
 {
     throw new System.NotImplementedException();
 }