public function isBalanced()
    {
        foreach ($this->graph->getVertices() as $vertex) {
            if ($this->getDegreeInVertex($vertex) !== $this->getDegreeOutVertex($vertex)) {
                return false;
            }
        }

        return true;
    }
public function isBalanced()
    {
        foreach ($this->graph->getVertices() as $vertex) {
            if ($this->getDegreeInVertex($vertex) !== $this->getDegreeOutVertex($vertex)) {
                return false;
            }
        }

        return true;
    }
public function isBalanced ( ) { foreach ( $ this -> graph -> getVertices ( ) as $ vertex ) { if ( $ this -> getDegreeInVertex ( $ vertex ) !== $ this -> getDegreeOutVertex ( $ vertex ) ) { return false ; } } return true ; }
checks whether the indegree of every vertex equals its outdegree

@return boolean
@uses self::getDegreeInVertex()
@uses self::getDegreeOutVertex()
checks whether the indegree of every vertex equals its outdegree