This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Vertex;
use Graphp\Algorithms\ShortestPath\Dijkstra;
class DijkstraTest extends BaseShortestPathTest
{
protected function createAlg(Vertex $vertex)
{
return new Dijkstra($vertex);
}
/**
* @expectedException UnexpectedValueException
*/
public function testGraphParallelNegative()
{
// 1 -[10]-> 2
// | ^
// \--[-1]---/
$graph = new Graph();
$v1 = $graph->createVertex(1);
$v2 = $graph->createVertex(2);
$v1->createEdgeTo($v2)->setWeight(10);
$v1->createEdgeTo($v2)->setWeight(-1);
$alg = $this->createAlg($v1);
$alg->getEdges();
}
}