layout.reingold.tilford places two nodes on the same position

Bug #1067024 reported by Michal Burda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
New
Undecided
Unassigned

Bug Description

In some historical version of igraph (newest in january 2011), the following simple graph was drawn correctly:

 m <- matrix(c(0,0,1,1,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0), nrow=5)
 g <- graph.adjacency(m)
 plot(g, layout=layout.reingold.tilford)

Igraph version 0.6 places vertices "3" and "4" on the same coordinates:

> layout.reingold.tilford(g)
     [,1] [,2]
[1,] -1 0
[2,] 0 0
[3,] 0 1
[4,] 0 1
[5,] 1 0

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

I am not sure why this happens, but a possible workaround is to explicitly give the root vertices:

 m <- matrix(c(0,0,1,1,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0), nrow=5)
 g <- graph.adjacency(m)
 plot(g, layout=layout.reingold.tilford(g, root=c(3,4)))

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/465

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.