The R igraph library has a function are.connected()
g <- graph.ring(10)
are.connected(g, 1, 2)
# [1] TRUE
are.connected(g, 2, 4)
# [1] FALSE
for the list functions in the package, you might try looking help(package="igraph")
in the future.
source
to share