Thursday, 25 November 2010

Error: Output is not useful

The output is indeed, useless. In fact its the worst kind of useless, its double i = NaN useless.

Having completed my coarsening and an initial version of uncoarsening, I have spent the past few days placing the infamous Eades heuristic for graph drawing (my first implementation of a force directed graph drawing algorithm) on top. In theory, this is quick. In implementation, this is also quick, with it currently sat comfortably on top, a surprise for everyone involved (so just me...).

An unexpected consequence was a problem (a problem? i'm so surprised /sarcasm) with the algorithm itself. When a set of vertices are input, for example, a coarsened version of cube (coarsened by one level - so essentially 2dsquare.graph), the algorithm works up to an undefined point until all further values change to NaN (Not a Number).

After a little research as to what had happened, it turns out, in this instance, the cause is division by zero (meaning two of the vertices are in exactly the same position - something which shouldn't happen, odd...). Unlike integers, which throw useful exceptions when this occurs, doubles turn to Infinity, and/or NaN.

Moving on from my frustration and anger towards Java, the implementation appears to be going well and I am on schedule for my monthly deadline. My smaller deadline of getting an output that can be drawn before the end of the week, is still up to fate and the intake of cups of tea. I will update next when I have the chance/remember. Ciao.

No comments:

Post a Comment