Learn R Programming

gRbase (version 1.6-4)

rip: RIP ordering and junction tree.

Description

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.

Usage

rip(object, root = NULL, nLevels = NULL)
## S3 method for class 'graphNEL':
rip(object, root = NULL, nLevels = NULL)
## S3 method for class 'igraph':
rip(object, root = NULL, nLevels = NULL)
## S3 method for class 'matrix':
rip(object, root = NULL, nLevels = NULL)
ripMAT(amat, root = NULL, nLevels = NULL) 

jTree(object, ...)
## S3 method for class 'graphNEL':
jTree(object, method="mcwh",nLevels=rep(2,length(nodes(object))),...)
## S3 method for class 'igraph':
jTree(object, method="mcwh",nLevels=rep(2,length(V(object))),...)
## S3 method for class 'matrix':
jTree(object, method="mcwh",nLevels=rep(2,ncol(object)),...)

Arguments

object
An undirected graph represented either as a 'graphNEL', a 'matrix' or an 'igraph'.
root
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.
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'.
amat
Adjacency matrix
method
The triangulation method, "mcwh" is a C implementation of a minimum clique weight heuristic, "R" is a corresponding R implementation (experimental)
...
Additional arguments; currently not used

Value

  • rip returns a list (an object of class ripOrder. A print method exists for such objects.)

Details

The RIP ordering 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 jTree (for "junction tree") is just a wrapper for a call of triangulate followed by a call of rip.

See Also

mcs triangulate moralize ug, dag

Examples

Run this code
## graphNEL
uG <- ug(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st)
rip(uG)

## igraph
uG <- ug(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st, result="igraph")
rip(uG)

## adjacency matrix
uG <- ug(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st, result="matrix")
rip(uG)

Run the code above in your browser using DataLab