Learn R Programming

gRbase (version 1.4.4)

glist2adjMAT: Creates adjacency matrix for a graph from a list of generators

Description

Creates adjacency matrix for a graph from a list of generators. The graph is assumed to be undirected.

Usage

glist2adjMAT(glist, vn = uniquePrim(c(glist, recursive = TRUE)))

Arguments

glist
A list of generators.
vn
The names of the vertices in the graphs. These will be the row and column names of the matrix

Value

  • An adjacency matrix (or NULL if glist has length 0)

See Also

ug dag

Examples

Run this code
glist <- list(1:3,2:4,4:5)
am <- glist2adjMAT(glist)
## plot(coerceGraph(am, "igraph"))

Run the code above in your browser using DataLab