Package networkx :: Package drawing :: Module layout
[hide private]
[frames] | no frames]

Module layout

source code

Layout (positioning) algorithms for graph drawing.


Date: $Date: 2005-06-15 08:53:26 -0600 (Wed, 15 Jun 2005) $

Author: Aric Hagberg (hagberg@lanl.gov) Dan Schult(dschult@colgate.edu)

Functions [hide private]
 
circular_layout(G, dim=2)
Circular layout.
source code
 
shell_layout(G, nlist=None, dim=2)
Shell layout.
source code
 
random_layout(G, dim=2)
Random layout.
source code
 
spring_layout(G, iterations=50, dim=2, node_pos=None)
Spring force model layout
source code
 
spectral_layout(G, dim=2, vpos=None, iterations=1000, eps=0.001)
Return the position vectors for drawing G using spectral layout.
source code
 
graph_low_ev_pi(uhat, G, eps=0.001, iterations=10000)
Power Iteration method to find smallest eigenvectors of Laplacian(G).
source code
 
_gershgorin_setup(G)
Return a list of matrix properties to be used to iteratively multiply B*v where v is a vector and B=g*I-L and g is the Gershgorin estimate of the largest eigenvalue of L=Laplacian(G).
source code
 
_graph_gershgorin_dot_v(gg_data, v)
Returns B*v where B=g*I-L and g is the Gershgorin estimate of the largest eigenvalue of L.
source code
 
_test_suite() source code
Variables [hide private]
  __credits__ = ''
  __revision__ = '$Revision: 1033 $'
  __warningregistry__ = {('Not importing directory \'/usr/lib/py...
Function Details [hide private]

circular_layout(G, dim=2)

source code 

Circular layout.

Crude version that doesn't try to minimize edge crossings.

shell_layout(G, nlist=None, dim=2)

source code 

Shell layout. Crude version that doesn't try to minimize edge crossings.

nlist is an optional list of lists of nodes to be drawn at each shell level. Only one shell with all nodes will be drawn if not specified.

graph_low_ev_pi(uhat, G, eps=0.001, iterations=10000)

source code 

Power Iteration method to find smallest eigenvectors of Laplacian(G). Note: constant eigenvector has eigenvalue=0 but is not included in the count of smallest eigenvalues.

uhat -- list of p initial guesses (dicts) for the p eigenvectors. G -- The Graph from which Laplacian is calculated. eps -- tolerance for norm of change in eigenvalue estimate. iterations -- maximum number of iterations to use.

_gershgorin_setup(G)

source code 

Return a list of matrix properties to be used to iteratively multiply B*v where v is a vector and B=g*I-L and g is the Gershgorin estimate of the largest eigenvalue of L=Laplacian(G).

Used as input to graph_gershgorin_dot_v()

_graph_gershgorin_dot_v(gg_data, v)

source code 

Returns B*v where B=g*I-L and g is the Gershgorin estimate of the largest eigenvalue of L. (g=max( deg(n) + sum_u(|w_(n,u)|)

We use this to iterate and find the smallest eigenvectors of L.


Variables Details [hide private]

__warningregistry__

Value:
{('Not importing directory \'/usr/lib/python2.5/site-packages/Numeric\\
': missing __init__.py',
  <type 'exceptions.ImportWarning'>,
  19): 1}