adjacent_vertices: Adjacent vertices of multiple vertices in a graph

Description Usage Arguments Value See Also Examples

View source: R/interface.R

Description

This function is similar to neighbors, but it queries the adjacent vertices for multiple vertices at once.

Usage

1
adjacent_vertices(graph, v, mode = c("out", "in", "all", "total"))

Arguments

graph

Input graph.

v

The vertices to query.

mode

Whether to query outgoing (‘out’), incoming (‘in’) edges, or both types (‘all’). This is ignored for undirected graphs.

Value

A list of vertex sequences.

See Also

Other structural queries: [.igraph(), [[.igraph(), are_adjacent(), ends(), get.edge.ids(), gorder(), gsize(), head_of(), incident_edges(), incident(), is_directed(), neighbors(), tail_of()

Examples

1
2
g <- make_graph("Zachary")
adjacent_vertices(g, c(1, 34))

Example output

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

[[1]]
+ 16/34 vertices:
 [1]  2  3  4  5  6  7  8  9 11 12 13 14 18 20 22 32

[[2]]
+ 17/34 vertices:
 [1]  9 10 14 15 16 19 20 21 23 24 27 28 29 30 31 32 33

igraph documentation built on March 19, 2020, 5:13 p.m.