1

I am looking at GraphViz's neato graph layout utility. It uses stress majorization, on which I found a paper. I can't say that I followed all the math, but it does seem formulated for laying out a graph in an arbitrarily high dimensional space. I am interested in generating node coordinates in 3D space, but I see no indication that this is supported in neato. Does neato's stress majorization generate 3D layouts?

user2153235
  • 265
  • 6

2 Answers2

2

Not really, only if you provide the Z coordinate as input! See https://www.graphviz.org/faq/#Faq3D for more detail.
p.s. The VRML generator needs work.

sroush
  • 121
  • 2
0

According to the GraphViz forum answer, neato can be supplied with command line option -Gdimen=3 to generate nodes with 3D coordinates. I confirmed this in Bash:

# Extract 3D node coordinates from the laying out of test distances
neato -Gdimen=3 <<EndInputDistances | grep '\bpos=".*",$'
   graph G {
         node [label="" xlabel="\N" shape=point]; //optional
      A -- B [len=0.235775]
      A -- C [len=0.652547]
      A -- D [len=0.55973]
      A -- E [len=0.818456]
      A -- F [len=1.15465]
      A -- G [len=0.854722]
      A -- H [len=5.5227]
      A -- I [len=1.34589]
      A -- J [len=3.54823]
      A -- K [len=3.76446]
      B -- C [len=0.705402]
      B -- D [len=0.612585]
      B -- E [len=0.871248]
      B -- F [len=0.92202]
      B -- G [len=0.619055]
      B -- H [len=5.30155]
      B -- I [len=1.1126]
      B -- J [len=3.32248]
      B -- K [len=3.53941]
      C -- D [len=0.093438]
      C -- E [len=1.04822]
      C -- F [len=1.12001]
      C -- G [len=1.15562]
      C -- H [len=5.55643]
      C -- I [len=1.2144]
      C -- J [len=3.83315]
      C -- K [len=4.04868]
      D -- E [len=0.955712]
      D -- F [len=1.03057]
      D -- G [len=1.06578]
      D -- H [len=5.46601]
      D -- I [len=1.12436]
      D -- J [len=3.74375]
      D -- K [len=3.95929]
      E -- F [len=1.52546]
      E -- G [len=1.30344]
      E -- H [len=5.66555]
      E -- I [len=1.71811]
      E -- J [len=4.07063]
      E -- K [len=4.21716]
      F -- G [len=0.247014]
      F -- H [len=5.4171]
      F -- I [len=0.400343]
      F -- J [len=3.00052]
      F -- K [len=3.10713]
      G -- H [len=5.42413]
      G -- I [len=0.649788]
      G -- J [len=2.96942]
      G -- K [len=3.07688]
      H -- I [len=5.49541]
      H -- J [len=5.97982]
      H -- K [len=6.09039]
      I -- J [len=3.33034]
      I -- K [len=3.43739]
      J -- K [len=0.671053]
   }
EndInputDistances

The above generates these 3D coordinates:

pos="65.646,358.56,-27.811", pos="80.526,353.04,-21.496", pos="72.666,403.22,-15.719", pos="74.3,396.72,-16.502", pos="34.696,353.3,20.593", pos="139.7,356.2,-14.918", pos="125.7,344.67,-14.841", pos="12.8,1.8,-131.09", pos="154.5,379.75,-23.846", pos="253.25,259.03,137.45", pos="274,226.91,108.17",

The z-positions average to 0, within a tolerance of $10^{-3}$.

user2153235
  • 265
  • 6