We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a392211 commit d0390c2Copy full SHA for d0390c2
src/MinimumSpanningTree/Kruskal.php
@@ -46,12 +46,8 @@ public function getEdges()
46
if ($edge instanceof EdgeDirected) {
47
throw new UnexpectedValueException('Kruskal for directed edges not supported');
48
}
49
- $weight = $edge->getWeight();
50
- if ($weight === NULL) {
51
- throw new UnexpectedValueException('Kruskal for edges with no weight not supported');
52
- }
53
// Add edges with negativ Weight because of order in stl
54
- $sortedEdges->insert($edge, - $weight);
+ $sortedEdges->insert($edge, -$edge->getWeight());
55
56
57
0 commit comments