# V

##### Vertices of a graph

Create a vertex sequence (vs) containing all vertices of a graph.

##### Usage

`V(graph)`

##### Arguments

- graph
The graph

##### Details

A vertex sequence is just what the name says it is: a sequence of vertices. Vertex sequences are usually used as igraph function arguments that refer to vertices of a graph.

A vertex sequence is tied to the graph it refers to: it really denoted the specific vertices of that graph, and cannot be used together with another graph.

At the implementation level, a vertex sequence is simply a vector containing numeric vertex ids, but it has a special class attribute which makes it possible to perform graph specific operations on it, like selecting a subset of the vertices based on graph structure, or vertex attributes.

A vertex sequence is most often created by the `V()`

function. The
result of this includes all vertices in increasing vertex id order. A
vertex sequence can be indexed by a numeric vector, just like a regular
R vector. See `[.igraph.vs`

and additional links to other
vertex sequence operations below.

##### Value

A vertex sequence containing all vertices, in the order of their numeric vertex ids.

##### Indexing vertex sequences

Vertex sequences mostly behave like regular vectors, but there are some
additional indexing operations that are specific for them;
e.g. selecting vertices based on graph structure, or based on vertex
attributes. See `[.igraph.vs`

for details.

##### Querying or setting attributes

Vertex sequences can be used to query or set attributes for the
vertices in the sequence. See `$.igraph.vs`

for details.

##### See Also

Other vertex and edge sequences: `$.igraph.es`

,
`$<-.igraph.es`

, `E<-`

,
`[<-.igraph.es`

,
`[[<-.igraph.es`

,
`igraph-es-attributes`

,
`igraph-es-attributes`

,
`igraph-es-attributes`

,
`igraph-es-attributes`

,
`igraph-es-attributes`

;
`$.igraph.vs`

, `$<-.igraph.vs`

,
`V<-`

, `[<-.igraph.vs`

,
`[[<-.igraph.vs`

,
`igraph-vs-attributes`

,
`igraph-vs-attributes`

,
`igraph-vs-attributes`

,
`igraph-vs-attributes`

,
`igraph-vs-attributes`

; `E`

;
`[.igraph.es`

, `%--%`

,
`%->%`

, `%<-%`

,
`igraph-es-indexing`

;
`[.igraph.vs`

,
`igraph-vs-indexing`

;
`[[.igraph.es`

,
`igraph-es-indexing2`

;
`[[.igraph.vs`

,
`igraph-vs-indexing2`

;
`print.igraph.es`

;
`print.igraph.vs`

##### Examples

```
# NOT RUN {
# Vertex ids of an unnamed graph
g <- make_ring(10)
V(g)
# Vertex ids of a named graph
g2 <- make_ring(10) %>%
set_vertex_attr("name", value = letters[1:10])
V(g2)
# }
```

*Documentation reproduced from package igraph, version 1.0.1, License: GPL (>= 2)*