Neato's hier mode is broken since v2.44.0
One of the regression tests trigger this bug, but since they don't run in CI yet because the reference data is not up-to-date, we haven't noticed. It is however possible to see if you eyeball the 135 generated output files and compare with the reference files (
To reproduce:
neato -Tps -Gmode=hier -o tmp2.45-bug.ps rtest/graphs/mode.gv
Compare by:
evince tmp.ps rtest/linux.x86/mode_neato1.ps
The test uses postscript, but it's the same problem for e.g. SVG.
With v2.44.0:
With v2.42.4:
The bug was introduced with the new SGD
mode here and is fixed by:
diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c
index 7d9e3c464..c2c36914e 100644
--- a/lib/neatogen/neatoinit.c
+++ b/lib/neatogen/neatoinit.c
@@ -1351,10 +1351,10 @@ neatoLayout(Agraph_t * mg, Agraph_t * g, int layoutMode, int layoutModel,
MaxIter = atoi(str);
else if (layoutMode == MODE_MAJOR)
MaxIter = DFLT_ITERATIONS;
- else if (layoutMode == MODE_KK)
- MaxIter = 100 * agnnodes(g);
else if (layoutMode == MODE_SGD)
MaxIter = 30;
+ else
+ MaxIter = 100 * agnnodes(g);
nG = scan_graph_mode(g, layoutMode);
if ((nG < 2) || (MaxIter < 0))