More generic queries (both ways)
Better width/height calculation taking into account the maximum out/in degree of the nodes