Drawing graphs using attracting and repelling forces

Questions and problems about using polymake go here.
ren
Posts: 38
Joined: 03 May 2011, 15:21

Drawing graphs using attracting and repelling forces

Postby ren » 13 Dec 2016, 19:46

Is there a tutorial on how to draw graphs in polymake using attracting and repelling forces? I mean as described in Section 4.1 of "Drawing polytopal graphs with polymake" (https://arxiv.org/abs/0711.2397)

I am currently looking for ways to arrange the Hasse Diagram of a tropical Kummer quadric a bit more nicely (so that the symmetries are more visible).

best regards and thanks in advance for any hints, Yue.

User avatar
joswig
Main Author
Posts: 280
Joined: 24 Dec 2010, 11:10

Re: Drawing graphs using attracting and repelling forces

Postby joswig » 14 Dec 2016, 12:32

I guess there is no tutorial. In that paper (which, by the way, appeared as Comput. Vis. Sci. 13 (2010), no. 2, 99–110) we only used functions that are implemented in polymake. Meaning those examples work out of the box.

The relevant code is in apps/graph/spring_embedder.cc (and the header files included there).

At any rate, graph drawing is a difficult business, and polymake is an amateur in this game. Professional software includes graphviz, which exists as a package for most distros. polymake has an interface (you might have to "reconfigure 'graphviz.rules'" in order to direct polymake to the dot executable) which you can use as in

Code: Select all

graphviz(cube(3)->HASSE_DIAGRAM->VISUAL);
Most likely, this will give you the best results. For even better visualization you should operate with graphviz directly.


Return to “Helpdesk”