protected int maxDepth(Layout.Node node){
  int depth=0;
  for (int i=0; i < node.numChildren(); i++) {
    Layout.Node child=node.getChild(i);
    depth=Math.max(depth,maxDepth(child));
  }
  return depth + 1;
}

protected int maxDepth ( Layout . Node node ) { int depth = 0 ; for ( int i = 0 ; i < node . numChildren ( ) ; i ++ ) { Layout . Node child = node . getChild ( i ) ; depth = Math . max ( depth , maxDepth ( child ) ) ; } return depth + 1 ; }
compute the depth of the graph .
