Skip to content

Commit 02afcfb

Browse files
committed
Update references to Cycle
1 parent a7dd9da commit 02afcfb

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/DetectNegativeCycle.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Fhaculty\Graph\Graph;
99
use Fhaculty\Graph\Vertex;
10+
use Fhaculty\Graph\Walk;
1011
use Fhaculty\Graph\Exception\NegativeCycleException;
1112
use Fhaculty\Graph\Algorithm\ShortestPath\MooreBellmanFord as SpMooreBellmanFord;
1213

@@ -34,7 +35,7 @@ public function hasCycleNegative()
3435
/**
3536
* Searches all vertices for the first negative cycle
3637
*
37-
* @return Cycle
38+
* @return Walk
3839
* @throws UnderflowException if there's no negative cycle
3940
* @uses AlgorithmSpMooreBellmanFord::getVerticesId()
4041
*/
@@ -72,7 +73,7 @@ public function getCycleNegative()
7273
* @return Graph
7374
* @throws Exception if there's no negative cycle
7475
* @uses AlgorithmDetectNegativeCycle::getCycleNegative()
75-
* @uses Cycle::createGraph()
76+
* @uses Walk::createGraph()
7677
*/
7778
public function createGraph()
7879
{

src/ShortestPath/MooreBellmanFord.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Fhaculty\Graph\Algorithm\ShortestPath;
44

55
use Fhaculty\Graph\Edge\Base as Edge;
6-
use Fhaculty\Graph\Cycle;
6+
use Fhaculty\Graph\Walk;
77
use Fhaculty\Graph\Exception\NegativeCycleException;
88
use Fhaculty\Graph\Exception\UnderflowException;
99

@@ -97,7 +97,7 @@ public function getEdges()
9797
// Check for negative cycles (only if last step didn't already finish anyway)
9898
// something is still changing...
9999
if ($changed && $changed = $this->bigStep($edges, $totalCostOfCheapestPathTo, $predecessorVertexOfCheapestPathTo)) {
100-
$cycle = Cycle::factoryFromPredecessorMap($predecessorVertexOfCheapestPathTo, $changed, Edge::ORDER_WEIGHT);
100+
$cycle = Walk::factoryCycleFromPredecessorMap($predecessorVertexOfCheapestPathTo, $changed, Edge::ORDER_WEIGHT);
101101
throw new NegativeCycleException('Negative cycle found', 0, NULL, $cycle);
102102
}
103103

@@ -107,7 +107,7 @@ public function getEdges()
107107
/**
108108
* get negative cycle
109109
*
110-
* @return Cycle
110+
* @return Walk
111111
* @throws UnderflowException if there's no negative cycle
112112
*/
113113
public function getCycleNegative()

src/TravelingSalesmanProblem/Base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Fhaculty\Graph\Algorithm\TravelingSalesmanProblem;
44

5-
use Fhaculty\Graph\Cycle;
5+
use Fhaculty\Graph\Walk;
66
use Fhaculty\Graph\Vertex;
77
use Fhaculty\Graph\Edge\Base as Edge;
88
use Fhaculty\Graph\Algorithm\Base as AlgorithmBase;
@@ -40,14 +40,14 @@ abstract protected function getVertexStart();
4040
/**
4141
* get (first) best circle connecting all vertices
4242
*
43-
* @return Cycle
43+
* @return Walk
4444
* @uses AlgorithmTsp::getEdges()
4545
* @uses AlgorithmTsp::getVertexStart()
46-
* @uses Cycle::factoryFromEdges()
46+
* @uses Walk::factoryCycleFromEdges()
4747
*/
4848
public function getCycle()
4949
{
50-
return Cycle::factoryFromEdges($this->getEdges(), $this->getVertexStart());
50+
return Walk::factoryCycleFromEdges($this->getEdges(), $this->getVertexStart());
5151
}
5252

5353
public function getWeight()

0 commit comments

Comments
 (0)