Subgraph Drawing
Oscar Benjamin
oscar.j.benjamin at gmail.com
Sun Jan 13 18:26:31 EST 2013
On 13 January 2013 20:05, <subhabangalore at gmail.com> wrote:
> 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.
I'm sorry, but I really don't understand what you mean. When you say
"subseries" do you mean "subgraph"? Or do you mean a subset of the
eigenvalues?
It would be good if you could give a simple example of what you mean
using code and showing the expected/desired output.
>
>>>> 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.
What is too slow?
Oscar
More information about the Python-list
mailing list