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)
object |
An undirected graph (of class 'graphNEL') |
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
ug <- newUG(~a:b+b:c+c:d+d:e+e:f+f:a) triangulate(ug)