public void BuildCompactGraph()
        {
            Verify();

            var splineGraphCompact = new DirectedGraph <SplineGraphPayload, SplineGraphPayloadSerializable>(Allocator.Persistent);

            splineGraph.BuildCompactDirectedGraph(ref splineGraphCompact, Allocator.Persistent);
            splineGraph.Dispose();
            splineGraph = splineGraphCompact;

            // Need to set the dirty flag here because the call to Verify() above cleared any dirty flags that were possibly set by UndoRecord()
            // and we have just changed our runtime data representation via BuildCompactDirectedGraph().
            isDirty = true;
        }