Description Usage Arguments Details Value Note Author(s) See Also Examples
This function will triangulate an undirected graph by adding fill-ins.
1 2 3 4 5 6 7 8 | triangulate(object, ...)
## S3 method for class 'graphNEL'
triangulate(object, method="mcwh", nLevels = rep(2,length(nodes(object))), result="graphNEL",...)
## S3 method for class 'matrix'
triangulate(object, method="mcwh", nLevels = rep(2,ncol(object)), result="matrix",...)
## S3 method for class 'Matrix'
triangulate(object, method="mcwh", nLevels = rep(2,ncol(object)), result="Matrix",...)
triangulateMAT(amat, method="mcwh", nLevels=rep(2,ncol(amat)), result=NULL, ...)
|
object |
An undirected graph represented either as a
|
method |
Triangulation method. Only valid option is "mcwh" (minimum clique weight heuristic). See section 'details'. |
nLevels |
Typically, the number of levels of the variables (nodes) when these are discrete. Used in determining the triangulation using a "minimum clique weight heuristic". See section 'details'. |
result |
The type (representation) of the result. Same possible representations as the input graph, and default is the same type as the input graph. |
... |
Additional arguments, currently not used. |
amat |
Adjacency matrix; a (dense) |
The triangulation is made so as the total state space is kept low by applying a minimum clique weight heuristic: When a fill-in is necessary, the algorithm will search for an edge to add such that the complete set to be formed will have as small a state-space as possible.
If nLevels
is the same for all nodes then the heuristic aims at keeping the
clique sizes small.
A
triangulated graph represented either as a graphNEL
, a (dense)
matrix
or a (sparse) dgCMatrix
.
The workhorse is the triangulateMAT
function.
S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk
ug
dag
mcs
, mcsMAT
rip
, ripMAT
,
moralize
, moralizeMAT
1 2 3 4 5 6 7 8 9 10 11 | ## graphNEL
uG1 <- ug(~a:b+b:c+c:d+d:e+e:f+f:a)
tuG1 <- triangulate(uG1)
## adjacency matrix
uG2 <- ug(~a:b+b:c+c:d+d:e+e:f+f:a, result="matrix")
tuG2 <- triangulate(uG2)
## adjacency matrix (sparse)
uG2 <- ug(~a:b+b:c+c:d+d:e+e:f+f:a, result="Matrix")
tuG2 <- triangulate(uG2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.