public static function factoryCycleFromVertices($vertices, $by = null, $desc = false)
    {
        $cycle = self::factoryFromVertices($vertices, $by, $desc);

        if ($cycle->getEdges()->isEmpty()) {
            throw new InvalidArgumentException('Cycle with no edges can not exist');
        }

        if ($cycle->getVertices()->getVertexFirst() !== $cycle->getVertices()->getVertexLast()) {
            throw new InvalidArgumentException('Cycle has to start and end at the same vertex');
        }

        return $cycle;
    }