Pinning nodes with sfdp

Is there a way to pin nodes with sfdp?

I can get it to work with neato by specifying pos=(x,y) and pin=true for my node but when I do the same with sfdp the pinned location is just ignored.


Unfortunately, no. This is on

Unfortunately, no. This is on our list of features to provide but the multiscale implementation of sfdp makes the implementation non-trivial.

Pinning nodes in neato, fdp and sfdp

Thanks for the reply.  I look forward to the new feature once you complete it.

Do you expect the pinning feature for sfdp to be implemented like the neato one or more like the fdp one?

If you runt the graph below with neato it is as if the pinned nodes are added to the graph AFTER the global energy function has been minimized.  The pinned nodes don't seem to have any impact on the placement of the other unpinned nodes.

The fdp algorithm works more like I would expect.  The pinned nodes are fixed on the graph but cause the unpinned nodes on the graph to move to better global equilibrium points.

graph g {
graph [overlap=false];
1 [pos="0,10", pin=true];
2 [pos="10,0", pin=true];
1 -- 2;
1 -- 5;
2 -- 4;
3 -- 4;
3 -- 5;
3 -- 6;
4 -- 6;
5 -- 6;

The default solver for neato

The default solver for neato uses stress majorization. This is very clean and efficient, but it doesn't play well with pinned nodes. You might try neato -Gmode=KK. This uses the original implementation of neato, which is closer to what fdp does.

Recent comments