NOTE: this post was written on the 25/10/2010 and was failed to be published. Instead of loosing this update, I am going to publish now.
Since my last post, I have corrected the NaN error given to me by those nasty irritable doubles (Sod's law at its finest, after complaining about the problem to the world, it gets fixed).
The error, as mentioned previously, was caused by division of zero due to two vertices being on the exact same spot (distance apart = 0.0). Having looked over the code and spending more time than I would like with my face in the debugger (according to the radio Ive been here for 7hrs 35mins...), it appears for reasons unknown, the list of vertices has added an additional vertex (the last has been added twice).
This was easily fixed by adding a loop to check if the vertex has already been added (inefficient for now as this shouldnt be necessary but I can worry about this later). This led to the very first output from my multilevel graph drawing algorithm, albeit a drawing of a coarsened graph.
Unfortunately nothing ever works the way we want it to and the drawing was of a very straight line along x=y. Now to me, this means that the forces added to the location are either all the same, or counteract each other. Outputting each step as it happened showed that everything was happening twice, and the algorithm (unchanged from my original implementation) was ignoring whether vertices were adjacent or not. See below for an example of output.
Apparently, putting the Eade's algorithm into its own method, fixed this problem. I will have to compare the code in order to fully understand what is happening as this should not be the cause, but I will see.
Thanks to this little change, the graph drawn for cube.graph (a 3d cube), resembles that of 2dsquare.graph (remember, a 3d cube coarsened is a 2d square if coarsened perfectly).
Next on the agenda, iterating these coordinates down into the uncoarsened graph. Uncoarsening works on itself, so now placing the lower level vertices is all that is left. I forecast this for tomorrow (Friday evening) if all goes smoothly - which as always, will not happen.
Have a good weekend if I dont update you sooner.
No comments:
Post a Comment