varivera / aliasing-java

0 stars 0 forks source link

Graph comparison #3

Open varivera opened 6 years ago

varivera commented 6 years ago

There's a need for a better comparison implementation of graphs. As it is right now, every time the Id class changes its strategy to generate identifiers, a manual change on tests is required. For instance, these to graphs should be identical

[(0, w, 5), (0, v, 7), (0, z, 7)] and [(0, w, 3), (0, v, 17), (0, z, 17)]

-> use '0' as the root, then the comparison is easier

varivera commented 6 years ago

One option (not necessarily efficient but ok for testing purposes):

We can assume graphs are finite and rooted (by definition of alias diagrams) then:

let comp be the set of all possible paths in the graph. For instance, or graph G = [(0, w, 5), (0, v, 7), (0, z, 7), (7, t, 8)], comp (G) = {w, v, z, z.t}. Comparison of graphs G and G' is comp(G) = comp(G')

Update: comp is a multiset (instead of a set), hence, comparison should be between multisets