Learn R Programming

gRapHD (version 0.2.5)

MCS: Maximum cardinality search

Description

Returns a perfect ordering of the edges.

Usage

MCS(model=NULL,edges=NULL,v=0,p=NULL)

Arguments

model

gRapHD object.

edges

matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge.

v

initial vertex (0<=v<=p). If v=0, the algorithm starts from vertex 1.

p

number of vertices.

Value

Zero if the graph is not triangulated, or a vector with the number of each vertex in the perfect ordering.

Details

Returns a perfect ordering of the vertices. For mixed graphs, the discrete vertices appear before the continuous vertices, in each connected component.

References

Tarjan, R.E., Yannakakis, M. Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM J. Comput., Vol 13, 3:566-79.

Leimer, H. Triangulated graphs with marked vertices. Ann. Discr. Maths., Vol 41, 311-324.

Examples

Run this code
# NOT RUN {
set.seed(7,kind="Mersenne-Twister")
dataset <- matrix(rnorm(1000),nrow=100,ncol=10)
m <- minForest(dataset,stat="BIC")

MCS(edges=m@edges,v=1,p=10)
# }

Run the code above in your browser using DataLab