private function getVerticesNeighbor(Vertex $vertex)
    {
        $vertices = array();
        foreach ($vertex->getEdges() as $edge) {
            /* @var Edge $edge */
            if (!($edge instanceof UndirectedEdge)) {
                throw new UnexpectedValueException('Directed edge encountered');
            }
            $vertices[] = $edge->getVertexToFrom($vertex);
        }
        return new Vertices($vertices);
    }
private function getVerticesNeighbor(Vertex $vertex)
    {
        $vertices = array();
        foreach ($vertex->getEdges() as $edge) {
            /* @var Edge $edge */
            if (!($edge instanceof UndirectedEdge)) {
                throw new UnexpectedValueException('Directed edge encountered');
            }
            $vertices[] = $edge->getVertexToFrom($vertex);
        }
        return new Vertices($vertices);
    }
private function getVerticesNeighbor ( Vertex $ vertex ) { $ vertices = array ( ) ; foreach ( $ vertex -> getEdges ( ) as $ edge ) { /* @var Edge $edge */ if ( ! ( $ edge instanceof UndirectedEdge ) ) { throw new UnexpectedValueException ( 'Directed edge encountered' ) ; } $ vertices [ ] = $ edge -> getVertexToFrom ( $ vertex ) ; } return new Vertices ( $ vertices ) ; }
get neighbor vertices for given start vertex

@param Vertex $vertex
@throws UnexpectedValueException for directed edges
@return Vertices (might include possible duplicates)
@uses Vertex::getEdges()
@uses Edge::getVertexToFrom()
@see Vertex::getVerticesEdge()
get neighbor vertices for given start vertex