简体   繁体   中英

Check if 2 vertices are connected in Igraph for R

what are the functions which check if two vertices (specified by their name attribute) are connected by an edge (incoming or outgoing or both) or not? in other words what are the name of the functions get_eid and are_connected of python in igraph in R ?

thank you in advance,

There is an are.connected() function in R's igraph library

g <- graph.ring(10)
are.connected(g, 1, 2)
# [1] TRUE
are.connected(g, 2, 4)
# [1] FALSE

for a list functions in the package, you can try looking at help(package="igraph") in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM