public function isSimple()
    {
        $vertices = $this->walk->getVertices()->getVector();
        // ignore starting vertex for cycles as it's always the same as ending vertex
        if ($this->isCycle()) {
            unset($vertices[0]);
        }

        return !$this->hasArrayDuplicates($vertices);
    }
public function isSimple()
    {
        $vertices = $this->walk->getVertices()->getVector();
        // ignore starting vertex for cycles as it's always the same as ending vertex
        if ($this->isCycle()) {
            unset($vertices[0]);
        }

        return !$this->hasArrayDuplicates($vertices);
    }
public function isSimple ( ) { $ vertices = $ this -> walk -> getVertices ( ) -> getVector ( ) ; // ignore starting vertex for cycles as it's always the same as ending vertex if ( $ this -> isCycle ( ) ) { unset ( $ vertices [ 0 ] ) ; } return ! $ this -> hasArrayDuplicates ( $ vertices ) ; }
check whether this walk is simple

contains no duplicate/repeated vertices (and thus no duplicate edges either)
other than the starting and ending vertices of cycles.

A simple Walk is also known as a chain.

The term "simple walk" is somewhat related to a walk with no cycles. If
a Walk has a cycle, it is not simple - with one single exception: a Walk
that IS a cycle automatically also contains a cycle, but if it contains
no "further" additional cycles, it is considered a simple cycle.

The following Graph represents a (very) simple Walk:

1 -- 2

The following Graph IS a cycle and is simple:

1 -> 2
^    |
\----/

The following Graph contains a cycle and is NOT simple:

/->4
|
1 -> 2 -> 3 -\
^       |
\-------/

The following Graph IS a cycle and thus automatically contains a cycle.
Due to the additional "inner" cycle (loop at vertex 2), it is NOT simple:

/->3--\
|     |
1 -> 2 -\  |
^    ^  |  |
|    \--/  |
|          |
\----------/

@return boolean
@uses self::isCycle()
@uses self::hasArrayDuplicates()
@see self::hasCycle()
check whether this walk is simple