View source: R/triangles.search.R
Search for triangles in an undirected graph | R Documentation |
Search for triangles in an undirected graph.
triangles.search(G)
G |
The adjacency matrix of an undirected graph. G[i, j] = G[j, i] = 1 means there is an edge between modes i and j. Zero values indicate the absence of edges. |
The functions searches for triangles, that is for tripletes of nodes (or variables) for which X-Y, Y-Z and X-Z.
A matrix with thre columns. If there are no triangles, the matrix is empty. If there is at least one triangle, then each row contains three numbers, one for each node. See the examples below.
Michail Tsagris
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr
plotnetwork, pc.skel, mmhc.skel
set.seed(123) x <- rdag2(1000, p = 20, nei = 4)$x a <- pc.skel(x, alpha = 0.05) plotnetwork(a$G) triangles.search(a$G)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.