graph_tool.draw.arf_layout#

graph_tool.draw.arf_layout(g, weight=None, d=0.5, a=10, dt=0.001, epsilon=1e-06, max_iter=1000, pos=None, dim=2)[source]#

Calculate the ARF spring-block layout of the graph.

Parameters:
gGraph

Graph to be used.

weightEdgePropertyMap (optional, default: None)

An edge property map with the respective weights.

dfloat (optional, default: 0.5)

Opposing force between vertices.

afloat (optional, default: 10)

Attracting force between adjacent vertices.

dtfloat (optional, default: 0.001)

Iteration step size.

epsilonfloat (optional, default: 1e-6)

Convergence criterion.

max_iterint (optional, default: 1000)

Maximum number of iterations. If this value is 0, it runs until convergence.

posVertexPropertyMap (optional, default: None)

Vector vertex property maps where the coordinates should be stored.

dimint (optional, default: 2)

Number of coordinates per vertex.

Returns:
posVertexPropertyMap

A vector-valued vertex property map with the coordinates of the vertices.

Notes

This algorithm is defined in [geipel-self-organization-2007], and has complexity \(O(V^2)\).

References

[geipel-self-organization-2007]

Markus M. Geipel, “Self-Organization applied to Dynamic Network Layout”, International Journal of Modern Physics C vol. 18, no. 10 (2007), pp. 1537-1549, DOI: 10.1142/S0129183107011558 [sci-hub, @tor], arXiv: 0704.1748v5

Examples

>>> g = gt.price_network(300)
>>> pos = gt.arf_layout(g)
>>> gt.graph_draw(g, pos=pos, output="graph-draw-arf.pdf")
<...>
../_images/graph-draw-arf.png

ARF layout of a Price network.#