/// <summary>
        /// Raise the level of the edge, optionally inserting into higher level trees
        /// </summary>
        public void RaiseLevel()
        {
            // Update position in edge lists
            source.RemoveEdge(this);
            dest.RemoveEdge(this);
            level++;
            EdgeListUtility.InsertEdge(source.adjacent, this);
            EdgeListUtility.InsertEdge(dest.adjacent, this);

            // Update flags for s
            if (source.euler.Count <= level)
            {
                source.euler.Add(EulerVertex <DynamicNode <T> > .Create(source));
            }
            var es = source.euler[level];

            es.SetFlag(true);

            // Update flags for t
            if (dest.euler.Count <= level)
            {
                dest.euler.Add(EulerVertex <DynamicNode <T> > .Create(dest));
            }
            var et = dest.euler[level];

            et.SetFlag(true);

            // If the edge is already part of a spanning tree, relink them in the next level
            if (euler != null)
            {
                euler.Add(es.Link(et, this));
            }
        }
        public static DynamicVertex <T> Create(T value)
        {
            var v = new DynamicVertex <T>()
            {
                value    = value,
                adjacent = new List <DynamicEdge <T> >()
            };
            var euler = new List <EulerVertex <DynamicNode <T> > >();

            euler.Add(EulerVertex <DynamicNode <T> > .Create(v));
            v.euler = euler;
            return(v);
        }
        /// <summary>
        /// Add an edge to all spanning forests with level <= this.level
        /// </summary>
        public void LinkSpanningForests()
        {
            var es = source.euler;
            var et = dest.euler;

            euler = new List <EulerHalfEdge <DynamicNode <T> > >();
            for (int i = 0; i <= level; i++)
            {
                if (es.Count <= i)
                {
                    es.Add(EulerVertex <DynamicNode <T> > .Create(source));
                }
                if (et.Count <= i)
                {
                    et.Add(EulerVertex <DynamicNode <T> > .Create(dest));
                }
                euler.Add(es[i].Link(et[i], this));
            }
        }