public static function factoryCycleFromEdges($edges, Vertex $startVertex)
    {
        $cycle = self::factoryFromEdges($edges, $startVertex);

        // ensure this walk is actually a cycle by checking start = end
        if ($cycle->getVertices()->getVertexLast() !== $startVertex) {
            throw new InvalidArgumentException('The given array of edges does not represent a cycle');
        }

        return $cycle;
    }
public static function factoryCycleFromEdges($edges, Vertex $startVertex)
    {
        $cycle = self::factoryFromEdges($edges, $startVertex);

        // ensure this walk is actually a cycle by checking start = end
        if ($cycle->getVertices()->getVertexLast() !== $startVertex) {
            throw new InvalidArgumentException('The given array of edges does not represent a cycle');
        }

        return $cycle;
    }
public static function factoryCycleFromEdges ( $ edges , Vertex $ startVertex ) { $ cycle = self :: factoryFromEdges ( $ edges , $ startVertex ) ; // ensure this walk is actually a cycle by checking start = end if ( $ cycle -> getVertices ( ) -> getVertexLast ( ) !== $ startVertex ) { throw new InvalidArgumentException ( 'The given array of edges does not represent a cycle' ) ; } return $ cycle ; }
create new cycle instance with vertices connected by given edges

@param  Edges|Edge[] $edges
@param  Vertex       $startVertex
@return Walk
@throws InvalidArgumentException if the given array of edges does not represent a valid cycle
@uses self::factoryFromEdges()
create new cycle instance with vertices connected by given edges