skieffer / hola

Human-like Orthogonal Layout Algorithm
46 stars 10 forks source link

Unusable Water Level 0 #3

Closed jdwaterson closed 8 years ago

jdwaterson commented 8 years ago

Hi there, I'm really interested in this algorithm, it looks wonderful, so first of all, let me say thanks for your work on it, and for making it available.

I've now managed to build and successfully use the hola_basic Python wrapper on a few sample graphs. Unfortunately it fails completely when I try to use it on my first real-world graph. Here is what I get:

$ ./hola_basic < arc2.gml >! arc-hola.gml                                                                 
Error: Positive water level route has no bends
Error: Positive water level route has no bends
Traceback (most recent call last):
  File "./hola_basic", line 16, in <module>
    main()
  File "./hola_basic", line 11, in main
    hola(G)
  File "/Users/jdw/src/hola/hola/hola.py", line 468, in hola
    faceset = reattachTrees2(P, trees, iel, projLogger, config)
  File "/Users/jdw/src/hola/hola/treeplacement.py", line 65, in reattachTrees2
    favourIsolation=config.TREE_PLACEMENT_FAVOUR_ISOLATION
  File "/Users/jdw/src/hola/hola/treeplacement.py", line 192, in chooseBestPlacement
    tp.evaluateCost(iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 795, in evaluateCost
    self.evaluateExpansionOptions(iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 774, in evaluateExpansionOptions
    self.expansionOptions = self.face.evaluateExpansionOptions(self, iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 1601, in evaluateExpansionOptions
    projseqs.extend(wd.buildProjSeqs(ps0))
  File "/Users/jdw/src/hola/hola/water.py", line 133, in buildProjSeqs
    pses = g0.tryAllLevelsRec(ps0, grem)
  File "/Users/jdw/src/hola/hola/water.py", line 259, in tryAllLevelsRec
    raise Exception(msg)
Exception: Unusable Level 0!
Raised at lineno: 685

I've attached the relevant arc2.gml input file (renamed as .txt to keep github happy), which was generated by yED and renders quite happily in there.

arc2.gml.txt

Is there likely to be an easy fix for this, or would it require significant rework?

Many thanks for any advice you can provide.

skieffer commented 8 years ago

Thanks for your interest! This crash pointed out a surprising oversight in the code, so thanks for that. Fixed now. At least, the example you sent now works. : )

jdwaterson commented 8 years ago

Most excellent thanks, I've pulled the changes and can confirm it now works here.

zhuyali commented 6 years ago

I meet the same problem, and the gml files in test dir can not work well. How can i fix this problem ?

skieffer commented 6 years ago

Can you provide a particular example on which you're getting this error?