are_adjacent: Are two vertices adjacent?

Description Usage Arguments Value See Also Examples

View source: R/structure.info.R

Description

The order of the vertices only matters in directed graphs, where the existence of a directed (v1, v2) edge is queried.

Usage

1

Arguments

graph

The graph.

v1

The first vertex, tail in directed graphs.

v2

The second vertex, head in directed graphs.

Value

A logical scalar, TRUE is a (v1, v2) exists in the graph.

See Also

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

Examples

1
2
3
4
5
6
7
8
9
ug <- make_ring(10)
ug
are_adjacent(ug, 1, 2)
are_adjacent(ug, 2, 1)

dg <- make_ring(10, directed = TRUE)
dg
are_adjacent(ug, 1, 2)
are_adjacent(ug, 2, 1)

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

Related to are_adjacent in igraph...