sfdp_layout force parameters

Hi there,

After trying four other force-directed graph layout implementations, I was
very happy to find graph-tool's sfdp_layout, which easily handles graphs
with O(10^6) nodes while still offering a number of layout customizations.

I'd like to better understand the intended effects of some of the
sfdp_layout parameters. I've included below a script featuring a toy graph
that I've been experimenting with. It seems that increasing C -- the
relative strength of repulsive force -- doesn't have any effect on the
layout. Meanwhile, increasing mu -- the strength of the attractive force --
seems to /reduce/ vertex clustering.

Any insight into this behavior? Am I misunderstanding the documentation?

Thanks,
Pete

The SFDP algorithm is indeed difficult to control precisely, since it
depends non-trivially on the actual structure of the graph.

The parameter C indeed does not produce a visible difference, but you
can see that the actual _values_ of the positions do change... You
should get a more spread-out layout (in absolute values) for larger
values of C. The same holds for the parameter K: the "optimal edge
length". These change the scale of the positions, but not the actual
visible layout.

The only way to visibly alter the layout is via the parameter p (the
repulsive force exponent), and the eweight properties. The latter will
provide a different layout only if the weight values are very different
for each edge.

I think you are indeed misunderstanding the role of the parameter mu. It
only comes into play when you have disconnected graphs, or when you have
specified group assignments (via the 'groups' parameters). The purpose
of the groups + mu is to force groups of vertices to be closer in the
layout. When you leave 'groups' alone, but change 'mu', the effect is
that you add an additional global _attractive_ force between all nodes
in the graph, and hence you get the effect you are seeing: A reduced
clustering.

Best,
Tiago