LucPrestin / Hidden-Modularity

MIT License
1 stars 0 forks source link

Implement a difference operation on HMGraphs #62

Open LucPrestin opened 2 years ago

LucPrestin commented 2 years ago

Describe the solution you'd like

For scenarios like comparing event handling methods (#9) or fetching the google website (#15) it would be nice to visualize the difference in the graphs we create as these can sometimes be quite small and thus not recognizable by putting the two graphs next to each other.

Therefore it would be nice to "substract" one graph from the other and visualize the difference.

Hints & Thoughts

Probably the easiest way is go substract the edges and then remove vertices according to edges. We would first substract the weights of matching edges from one another. Edges that have a positive edge weight now are still in the graph. If the edge weight is 0, the edge gets deleted. The question is what to do with resulting negative edges and non-matching edges?

For the former, we could keep them this way in the graph, as negative edge weights would result in the node being push away further. This could also be misleading as there shouldn't be really a node left.

For the latter, the problem is really the same as for the first. Do we allow for negative edges that weren't there in graph A and would we potentially draw new nodes for this? Probably not.