MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: GraphPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70801] Re: [mg70775] GraphPlot
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Sat, 28 Oct 2006 05:21:38 -0400 (EDT)
  • References: <200610270428.AAA24447@smc.vnet.net>

Matt Curcio wrote:

>Hi,
>	I have a question about extracting data from the internals of  
>GraphPlot.  For example, the following code plots multiple subplots  
>of disconnected clusters.
>
><< DiscreteMath`GraphPlot`
>n = 129;
>d = Table[i -> Mod[i^2, n], {i, 0, n - 1}];
>GraphPlot[d];
>
>However, I would like to know the subsets that are being plotted.  I  
>know you can plot the vertex labels on the chart, but my dataset is  
>~50,000 connected vertices and GraphPlot outputs ~100 clusters, so  
>vertex labeling is unrealistic.  It would be very interesting to know  
>which vertices GraphPlot has associated.  There maybe a way to do  
>this using some functions from "Combninatorica" but I have not been  
>able to find them.  Can anyone help?
>
>Thanks,
>Matt
>  
>
I'm not clear on what you want, but have you tried StrongComponents from 
the GraphPlot package? This function will give you a list of the 
vertices in each disconnected cluster (assuming the graph is 
undirected). In your example, we would convert d to an undirected graph 
and then use StrongComponents:

comps = StrongComponents[ Join[d, Reverse/@d] ];

In[30]:=
Length[comps]
Out[30]=
14

Carl Woll


  • References:
    • GraphPlot
      • From: Matt Curcio <matt@aggregateknowledge.com>
  • Prev by Date: Re: Why all the if's the answer
  • Next by Date: Modify a list of pure functions
  • Previous by thread: GraphPlot
  • Next by thread: Re: GraphPlot