[R] igraph plot slowness

jim holtman jholtman at gmail.com
Fri Jul 3 16:43:25 CEST 2015


Here is what it does locally on my PC:

> library("igraph")
>  topo_data <- read.table(text = "ibcore01        ibswitch01
+  ibcore01        ibswitch02
+  ibcore01        ibswitch03
+  ibcore02        ibswitch01
+  ibcore02        ibswitch02
+  ibcore02        ibswitch03
+  ibswitch01      node001
+  ibswitch01      node002
+  ibswitch01      node003
+  ibswitch02      node004
+  ibswitch02      node005
+  ibswitch02      node006
+  ibswitch03      node007
+  ibswitch03      node008
+  ibswitch03      node009" ,head=FALSE)
>  system.time({
+  network_data <-graph.data.frame(topo_data, directed=F)
+  plot(network_data)
+ })
   user  system elapsed
   0.01    0.01    0.03
>
>

Does not seem too slow.  Creating a PDF file takes a little longer:

> library("igraph")
>  topo_data <- read.table(text = "ibcore01        ibswitch01
+  ibcore01        ibswitch02
+  ibcore01        ibswitch03
+  ibcore02        ibswitch01
+  ibcore02        ibswitch02
+  ibcore02        ibswitch03
+  ibswitch01      node001
+  ibswitch01      node002
+  ibswitch01      node003
+  ibswitch02      node004
+  ibswitch02      node005
+  ibswitch02      node006
+  ibswitch03      node007
+  ibswitch03      node008
+  ibswitch03      node009" ,head=FALSE)
>  system.time({
+  network_data <-graph.data.frame(topo_data, directed=F)
+  pdf('test.pdf')
+  plot(network_data)
+  dev.off()
+ })
   user  system elapsed
   0.09    0.00    0.16

The PDF file is attached.  So maybe it is something with your remote
connection.




Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Fri, Jul 3, 2015 at 3:21 AM, Loris Bennett <loris.bennett at fu-berlin.de>
wrote:

> Hi,
>
> With the following data
>
> ibcore01        ibswitch01
> ibcore01        ibswitch02
> ibcore01        ibswitch03
> ibcore02        ibswitch01
> ibcore02        ibswitch02
> ibcore02        ibswitch03
> ibswitch01      node001
> ibswitch01      node002
> ibswitch01      node003
> ibswitch02      node004
> ibswitch02      node005
> ibswitch02      node006
> ibswitch03      node007
> ibswitch03      node008
> ibswitch03      node009
>
> in the file "topology.txt"
>
> and the following code:
>
> library("igraph")
> topo_data <- read.csv(file="topology.txt",head=FALSE,sep="\t")
> network_data <-graph.data.frame(topo_data, directed=F)
> plot(network_data)
>
> it takes about 5 seconds for the plot to be drawn with R 3.2.0 on a
> 12-core 2.67 GHz Xeon X5650 server with no other CPU-intensive processes
> running.
>
> This strikes me as rather slow, particularly as my full network has over
> 120 components and the plot takes around 50 seconds.
>
> Am I doing anything wrong?
>
> (I am working over an ssh connection with X forwarding, but plotting to
> a PDF file on the server does not seem to be faster.)
>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pdf
Type: application/pdf
Size: 7445 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150703/23571280/attachment.pdf>


More information about the R-help mailing list