Last chance! 50% off unlimited learning
Sale ends in
A RIP (running intersection property) ordering of the cliques is also called a perfect ordering. If the graph is not chordal, then no such ordering exists.
rip(object, ...)# S3 method for default
rip(object, root = NULL, nLevels = NULL, ...)
ripMAT(amat, root = NULL, nLevels = rep(2, ncol(amat)))
junction_tree(object, ...)
# S3 method for default
junction_tree(object, nLevels = NULL, ...)
junction_treeMAT(amat, nLevels = rep(2, ncol(amat)), ...)
An undirected graph represented either as a
graphNEL
object, an igraph
, a (dense)
matrix
, a (sparse) dgCMatrix
.
Additional arguments; currently not used
A vector of variables. The first variable in the perfect ordering will be the first variable on 'root'. The ordering of the variables given in 'root' will be followed as far as possible.
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'.
Adjacency matrix
rip
returns a list (an object of class
ripOrder
. A print method exists for such objects.)
The RIP ordering of the cliques of a decomposable
(i.e. chordal) graph is obtained by first ordering the
variables linearly with maximum cardinality search (by
mcs
). The root argument is transfered to mcs
as a
way of controlling which clique will be the first in the RIP
ordering. The junction_tree()
(and junction_tree()
) (for
"junction tree") is just a wrapper for a call of
triangulate()
followed by a call of rip()
.
# NOT RUN {
## graphNEL
uG <- ug(~me:ve + me:al + ve:al + al:an + al:st + an:st)
mcs(uG)
rip(uG)
junction_tree(uG)
## Adjacency matrix
uG <- ug(~me:ve:al + al:an:st, result="matrix")
mcs(uG)
rip(uG)
junction_tree(uG)
## Sparse adjacency matrix
uG <- ug(c("me", "ve", "al"), c("al", "an", "st"), result="dgCMatrix")
mcs(uG)
rip(uG)
junction_tree(uG)
## Non--decomposable graph
uG <- ug(~1:2 + 2:3 + 3:4 + 4:5 + 5:1)
mcs(uG)
rip(uG)
junction_tree(uG)
# }
Run the code above in your browser using DataLab