title: Graphs and version control
body: <p>I have a directed graph data structure, where I am trying to implement individual version control for each vertex. This creates some interesting scenarios, and I would much appreciate any ideas that you guys have. Specifically, I am looking to resolve the default behavior of the system when encountering the stated scenarios.</p>
  
  <p>See the following image: <a href="http://bayimg.com/faAGCaADD" rel="noreferrer">Graph versions</a></p>
  
  <p><strong>Scenario 1: "The Null Pointer Paradox"</strong></p>
  
  <p>Vertex A is rolled back to version 1.0. Since this rollback will cascade down its subgraph, C will no longer be pointing to D. This could create a hazard. Should the behavior be to:</p>
  
  <ul>
  <li>1.1: Delete the edge C -> D, creating a broken graph</li>
  <li>1.2: Delete D, leaving E orphaned</li>
  <li>1.3: Delete D and E</li>
  <li>1.4: Refuse to perform the rollback before all edges pointing to D (which would be E -> D in this case) are deleted</li>
  <li>1.X: Alternative solutions?</li>
  </ul>
  
  <p><strong>Scenario 2: "Indirect Effects"</strong></p>
  
  <p>Vertex D is updated, so that the following holds:</p>
  
  <ul>
  <li>D is now version 1.2</li>
  <li>E is now version 1.1</li>
  <li>C is now version 1.3</li>
  <li>A is now version 1.3</li>
  </ul>
  
  <p>Vertex A is now rolled back to version 1.2, so that the following holds:</p>
  
  <ul>
  <li>A is now version 1.2</li>
  <li>C is now version 1.2</li>
  <li>D is now version 1.1</li>
  </ul>
  
  <p>Should the default behavior be to:</p>
  
  <ul>
  <li>2.1: Roll back E to 1.0</li>
  <li>2.2: Refuse to roll back due to version hazard, in effect impairing functionality</li>
  <li>2.X: Alternative solutions?</li>
  </ul>