public function getAverageHeightOfGraph()
    {
        $ns = [];
        foreach ($this->graph->getRootNodes() as $node) {
            array_push($ns, $this->getLongestBranch($node));
        }
        return round(array_sum($ns) / max(1, sizeof($ns)), 2);
    }
public function getAverageHeightOfGraph()
    {
        $ns = [];
        foreach ($this->graph->getRootNodes() as $node) {
            array_push($ns, $this->getLongestBranch($node));
        }
        return round(array_sum($ns) / max(1, sizeof($ns)), 2);
    }
public function getAverageHeightOfGraph ( ) { $ ns = [ ] ; foreach ( $ this -> graph -> getRootNodes ( ) as $ node ) { array_push ( $ ns , $ this -> getLongestBranch ( $ node ) ) ; } return round ( array_sum ( $ ns ) / max ( 1 , sizeof ( $ ns ) ) , 2 ) ; }
Get average height of graph

@return float
Get average height of graph