# structure.info

From igraph v0.1.2
by Gabor Csardi

##### Gaining information about graph structure

Functions for exploring the basic structure of a network: number of vertices and edges, the neighbors of a node, test whether two vertices are connected by an edge.

- Keywords
- graphs

##### Usage

```
vcount(graph)
ecount(graph)
neighbors(graph, v, mode = 1)
is.directed(graph)
are.connected(graph, v1, v2)
```

##### Arguments

- graph
- The graph.
- v
- The vertex of which the neighbors are queried.
- mode
- Character string, specifying the type of neighboring
vertices to list in a directed graph. If
out the vertices*to*which an edge exist are listed, ifin the vertices*from*which an edge is dire - v1
- The id of the first vertex. For directed graphs only edges
pointing from
`v1`

to`v2`

are searched. - v2
- The id of the second vertex. For directed graphs only edges
pointing from
`v1`

to`v2`

are searched.

##### Details

These functions provide the basic structural information of a graph.

`vcount`

gives the number of vertices in the graph.

`ecount`

gives the number of edges in the graph.

`neighbors`

gives the neighbors of a vertex. The vertices
connected by multiple edges are listed as many times as the number of
connecting edges.
`is.directed`

gives whether the graph is directed or not. It just
gives its `directed`

attribute.
`are.connected`

decides whether there is an edge from `v1`

to `v2`

.

##### Value

`vcount`

and`ecount`

return integer constants.`neighbors`

returns an integer vector.`is.directed`

and`are.connected`

return boolean constants.

##### See Also

##### Examples

```
g <- graph.ring(10)
vcount(g)
ecount(g)
neighbors(g, 5)
are.connected(g, 1, 2)
are.connected(g, 2, 4)
```

*Documentation reproduced from package igraph, version 0.1.2, License: GPL version 2 or later (June, 1991)*

### Community examples

Looks like there are no examples yet.