Description Usage Arguments Value Author(s) See Also Examples
Creates adjacency matrix for a graph from a list of generators. The graph is assumed to be undirected.
1 2 | glist2adjMAT(glist, vn = uniquePrim(c(glist, recursive = TRUE)), result="matrix")
vpaL2adjMAT(vpaL, vn=uniquePrim(c(vpaL, recursive=TRUE)), result="matrix")
|
glist |
A list of generators for an undirected graph. |
vpaL |
A list of the form (v,pa(v)) specifying a directed acyclic graph. |
vn |
The names of the vertices in the graphs. These will be the row and column names of the matrix |
result |
Either |
An adjacency matrix (or NULL
if glist
has length 0)
S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk
1 2 3 4 5 6 7 | glist <- list(1:3,2:4,4:5)
am1 <- glist2adjMAT(glist)
am2 <- vpaL2adjMAT(glist)
if (interactive()){
plot(as(am1, "graphNEL"))
plot(as(am2, "graphNEL"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.