protected function checkBalance()
    {
        $alg = new AlgorithmFlow($this->graph);
        $balance = $alg->getBalance();

        $tolerance = 0.000001;
        if ($balance >= $tolerance || $balance <= -$tolerance) {
            throw new UnexpectedValueException('The given graph is not balanced value is: ' . $balance);
        }

        return $this;
    }
protected function checkBalance()
    {
        $alg = new AlgorithmFlow($this->graph);
        $balance = $alg->getBalance();

        $tolerance = 0.000001;
        if ($balance >= $tolerance || $balance <= -$tolerance) {
            throw new UnexpectedValueException('The given graph is not balanced value is: ' . $balance);
        }

        return $this;
    }
protected function checkBalance ( ) { $ alg = new AlgorithmFlow ( $ this -> graph ) ; $ balance = $ alg -> getBalance ( ) ; $ tolerance = 0.000001 ; if ( $ balance >= $ tolerance || $ balance <= - $ tolerance ) { throw new UnexpectedValueException ( 'The given graph is not balanced value is: ' . $ balance ) ; } return $ this ; }
check if balance is okay and throw exception otherwise

@throws UnexpectedValueException
@return AlgorithmMCF             $this (chainable)
check if balance is okay and throw exception otherwise