Previous to today's tinkering, I had a "roughly" working implementation of C.Walshaw's multilevel graph drawing algorithm, using P.Eade's heuristic as opposed to the more complex FR FDP algorithm. This wasn't yet the self iterating methodology described by C.Walshaw and required me to manually create different levels of a Graph G0, i.e. pseudo code below.
Graph G1 = coarsen(G0);
Graph G2 = coarsen(G1);
Attempting to finally retrieve some results, I needed a self iterating way of coarsening a graph, which fortunately was relatively easy given the way I had designed the code (with the limit of a graph must have 2 vertices at minimum). This affects the aesthetic view in an odd way which for now is not important, and appears to work ok.
The edges of the initial graph; after coarsening, FDP and uncoarsening, have changed. The only way I can describe it is, "They're broken." An example, printing the coordinates of edge e, e.v1 and e.v2, followed by the coordinates of all vertices:
e.v1.x: 0.8628966403487646 e.v1.y: -0.041670375602711654
e.v2.x: 0.8628966403487646 e.v2.y: -0.041670375602711654
x: 0.8628966403487646 y: -0.041670375602711654
x: 1.3628966403487646 y: 0.45832962439728836
x: 0.5485572219545054 y: 0.907640284847048
x: 1.0485572219545054 y: 1.407640284847048
x: 1.3628966403487646 y: 0.45832962439728836
x: 0.5485572219545054 y: 0.907640284847048
x: 1.0485572219545054 y: 1.407640284847048
This shows that the vertices belonging to the edge, are one of the same. Of course, this would normally affect the layout, however, the list of edges are not quite used in this case (I believe I mentioned this madness before; my use of an adjacent vertices list), so one wouldn't notice this issue until one looked for it.
I will update after some investigation and a fix (as other changes are required also). Good Day.
No comments:
Post a Comment