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 1fbfa9a commit 2e5a1b4Copy full SHA for 2e5a1b4
src/Property/WalkProperty.php
@@ -23,13 +23,16 @@ public function __construct(Walk $walk)
23
/**
24
* checks whether walk is a cycle (i.e. source vertex = target vertex)
25
*
26
+ * A walk with no edges is not considered a cycle. The shortest possible
27
+ * cycle is a single loop edge.
28
+ *
29
* @return bool
30
* @link http://en.wikipedia.org/wiki/Cycle_%28graph_theory%29
31
*/
32
public function isCycle()
33
{
34
$vertices = $this->walk->getVerticesSequence();
- return (reset($vertices) === end($vertices));
35
+ return (reset($vertices) === end($vertices) && $this->walk->getEdges());
36
}
37
38
0 commit comments