Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

are_adjacent

Are two vertices adjacent?


Description

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

Usage

are_adjacent(graph, v1, v2)

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

Examples

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

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.