triangulate {gRbase} | R Documentation |
This function will triangulate an undirected graph by adding fillins.
triangulate(object, method="mcwh", nLevels = rep(2,length(nodes(object))), matrix=FALSE) triangulateMAT(amat, method="mcwh", nLevels=rep(2,ncol(amat)))
object |
An undirected graph (of class 'graphNEL') |
amat |
An adjacency matrix (symmetrical) |
method |
Triangulation method. Either "mcwh" (minimum clique weight heuristic) which is implemented in C or "r" (an experimental R version) |
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'. |
matrix |
If TRUE the adjacency matrix is returned; if FALSE a graphNEL object is returned |
The triangulation is made so as the total state space is kept low.
A triangulated graph (an object of class 'graphNEL') or an adjacency matrix.
Søren Højsgaard, sorenh@agrsci.dk
ugr <- ug(~a:b+b:c+c:d+d:e+e:f+f:a) triangulate(ugr)