public function getVertexFirst()
    {
        if (!$this->vertices) {
            throw new UnderflowException('Does not contain any vertices');
        }
        reset($this->vertices);

        return current($this->vertices);
    }
public function getVertexFirst()
    {
        if (!$this->vertices) {
            throw new UnderflowException('Does not contain any vertices');
        }
        reset($this->vertices);

        return current($this->vertices);
    }
public function getVertexFirst ( ) { if ( ! $ this -> vertices ) { throw new UnderflowException ( 'Does not contain any vertices' ) ; } reset ( $ this -> vertices ) ; return current ( $ this -> vertices ) ; }
return first Vertex in this set of Vertices

some algorithms do not need a particular vertex, but merely a (random)
starting point. this is a convenience function to just pick the first
vertex from the list of known vertices.

@return Vertex             first Vertex in this set of Vertices
@throws UnderflowException if set is empty
@see self::getVertexOrder() if you need to apply ordering first
return first Vertex in this set of Vertices