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

is.connected

Tests if a graph is connected


Description

Tests if a graph represented by an adjacency matrix is connected.

Usage

is.connected(adj)

Arguments

adj

An adjacency matrix. Must be a numeric matrix with non-negative entries.

Details

Idea by Ed Scheinerman, circa 2006. Source: http://www.ams.jhu.edu/~ers/matgraph/; routine: matgraph/@graph/isconnected.m

Value

is.connected returns TRUE or FALSE depending on whether the graph represented in adj is a connected graph.

Author(s)

See Also

cluseigen, clust, browseVignettes("wsyn")

Examples

g1<-matrix(c(0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0),4,4)
is.connected(g1)
g2<-matrix(c(0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0),4,4)
is.connected(g2)

wsyn

Wavelet Approaches to Studies of Synchrony in Ecology and Other Fields

v1.0.3
GPL-3
Authors
Daniel C. Reuman [aut, cre], Thomas L. Anderson [aut], Jonathan A. Walter [aut], Lei Zhao [aut], Lawrence W. Sheppard [aut]
Initial release

We don't support your browser anymore

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