Skip to content

Commit 77d4c45

Browse files
committed
Fix outdated reference to Algorithm\Flow
1 parent c9a334c commit 77d4c45

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MinimumCostFlow/Base.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Fhaculty\Graph\Algorithm\BaseGraph;
66
use Fhaculty\Graph\Algorithm\Weight as AlgorithmWeight;
7+
use Fhaculty\Graph\Algorithm\Flow as AlgorithmFlow;
78
use Fhaculty\Graph\Exception\UnderflowException;
89
use Fhaculty\Graph\Edge\Base as Edge;
910
use Fhaculty\Graph\Set\Edges;
@@ -20,7 +21,9 @@ abstract class Base extends BaseGraph
2021
*/
2122
protected function checkBalance()
2223
{
23-
$balance = $this->graph->getBalance();
24+
$alg = new AlgorithmFlow($this->graph);
25+
$balance = $alg->getBalance();
26+
2427
$tolerance = 0.000001;
2528
if ($balance >= $tolerance || $balance <= -$tolerance) {
2629
throw new UnexpectedValueException('The given graph is not balanced value is: ' . $balance);

0 commit comments

Comments
 (0)