private double computeDepth ( ) throws WikiApiException { Category root = wiki . getMetaData ( ) . getMainCategory ( ) ; if ( root == null ) { logger . error ( "There is no root node for this wiki. Check the parameter that provides the name of the root node." ) ; return 0.0 ; } // test whether the root category is in this graph if ( ! graph . containsVertex ( root . getPageId ( ) ) ) { logger . error ( "The root node is not part of this graph. Cannot compute depth of this graph. Setting depth to 0.0" ) ; return 0.0 ; } double maxPathLength = 0.0 ; double [ ] returnValues = computeShortestPathLenghts ( root . getPageId ( ) , 0.0 , maxPathLength , new HashSet < Integer > ( ) ) ; maxPathLength = returnValues [ 1 ] ; return maxPathLength ; }
Computes the depth of the category graph i . e . the maximum path length starting with the root node .