igraph-help
[Top][All Lists]

## Re: [igraph] layout and node overlaps

 From: Gábor Csárdi Subject: Re: [igraph] layout and node overlaps Date: Mon, 13 Sep 2010 10:14:33 +0200

```Dear Angelo,

the igraph layout functions treat vertices as points, i.e. they do not
consider their size at all. To make sure that vertices don't overlap,
you need to find the closest vertices, and then scale the layout such
that even these closest do not touch.

Best,
Gabor

On Sun, Sep 12, 2010 at 9:21 PM, Angelo Felline
> Hi all,
> I'm doing some experiments with igraph and in particular with graph layouts.
> I can't figure out how to apply a layout to a given (real) graph avoiding
> node overlaps.
>
> In the following example if the variable NumOfNodes is setted to a small
> value (10) the
> layout function generates a plot without node overlaps. But even with a
> not-so-big number
> of nodes (50) plotted graph has almost all nodes overlapped by neighbors
> vertices.
>
> # R code
> require(igraph)
>
> NumOfNodes <- 10
>
> g <- barabasi.game(NumOfNodes)
> g\$layout <- layout.reingold.tilford(g)
> plot(g)
>
> NumOfNodes <- 50
>
> g <- barabasi.game(NumOfNodes)
> g\$layout <- layout.reingold.tilford(g)
> plot(g)
>
> The problem gets even worst if I increase vertex size.
>
> # R code
> require(igraph)
>
> NumOfNodes <- 10
>
> g <- barabasi.game(NumOfNodes)
> g\$size <- 1:NumOfNodes
> for(vv in 1:NumOfNodes)
> {
>   g\$size[vv] <- 40 # defualt values should be 15
> }
>
> g\$layout <- layout.reingold.tilford(g)
> plot(g)
>
> I'm using GraphViz at the moment, which has an option to avoid
> overlaps but I can't find something similar in igraph documentation.
>
> Can someone point me to the rigth direction ?
>
> a
>
> _______________________________________________
> igraph-help mailing list
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>

--