Subgraph Drawing

subhabangalore at gmail.com subhabangalore at gmail.com
Sun Jan 13 21:05:54 CET 2013


Dear Group,

I have two questions, if I take a subseries of the matrix as in eigenvalue here,
provided I have one graph of the full form in G, how may I show it, as if I do the nx.draw(G) it takes only the original graph. 

>>> import numpy
>>> import networkx as nx
>>> import matplotlib.pyplot as plt
>>> G=nx.Graph()
>>> G.add_edges_from([(1,2),(1,3),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8)])
>>> L =nx.laplacian(G)
>>> print L
[[ 7. -1. -1. -1. -1. -1. -1. -1.]
 [-1.  1.  0.  0.  0.  0.  0.  0.]
 [-1.  0.  1.  0.  0.  0.  0.  0.]
 [-1.  0.  0.  1.  0.  0.  0.  0.]
 [-1.  0.  0.  0.  1.  0.  0.  0.]
 [-1.  0.  0.  0.  0.  1.  0.  0.]
 [-1.  0.  0.  0.  0.  0.  1.  0.]
 [-1.  0.  0.  0.  0.  0.  0.  1.]]
>>> print numpy.linalg.eigvals(L)
[  8.00000000e+00   2.22044605e-16   1.00000000e+00   1.00000000e+00
   1.00000000e+00   1.00000000e+00   1.00000000e+00   1.00000000e+00]

for more than 1000 nodes it is coming too slow on Windows 7 machine with 3GB RAM.

If any one of the learned members can help.

Apology for any indentation error etc.

Thanking all in Advance,

Regards,
Subhabrata Banerjee.



More information about the Python-list mailing list