I'm looking for an algorithm which can diff
two Directed Acyclic Graphs(DAGs). That is, I'd like an algorithm which produces a sequence of deletions and insertions on the first DAG to produce the second DAG.
I'm not a hundred percent sure, but I think a longest common subsequence can be applied to the DAGs. I'm less concerned about the length of the resulting edit sequence (as long as it's short enough) and more concerned about the running time of the algorithm.
One complication is that none of my vertices are labelled except for a single root node. The root node is also the only node with zero in-edges. The graph's edges are labelled, and the 'data' in the graph is represented by the paths from the root to the leaves. This is similar to a trie
but with a directed graph instead of a tree. Actually my graphs are quite similar to the directed acyclic word graph
data structure.
Here's an example.
DAG1
DAG2
To get DAG 2, you simply add a vertex from the root to another vertex with label 'b'. From that vertex there is an edge to the final 'ac' vertex in DAG 1 and an edge to a new vertex whose label is 'd'. From that final vertex there is another edge to the 'ac' vertex in DAG 1. I'd post a link to the diff in DAG form, but I can't post more than two links.
Thanks and hope this is legible enough.