Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

separates

A function to test whether a subset of nodes separates two other subsets of nodes.


Description

The function tests to see whether a set of nodes, S1, separates all nodes in a from all nodes in b.

Usage

separates(a, b, S1, g)

Arguments

a

The names of the nodes in the from set.

b

The names of the nodes in the to set.

S1

The names of the nodes in the separation set.

g

An instance of the graph class. All nodes named in the other arguments must be nodes of this graph.

Details

The algorithm is quite simple. A subgraph is created by removing the nodes named in S1 from g. Then all paths between elements of a to elements of b are tested for. If any path exists the function returns FALSE, otherwise it returns TRUE.

Value

Either TRUE or FALSE depending on whether S1 separates a from b in g1.

Author(s)

R. Gentleman

References

S. Lauritzen, Graphical Models, OUP.

See Also

Examples

con <- file(system.file("XML/kmstEx.gxl",package="RBGL"))
  km <- fromGXL(con)
  close(con)

  separates("B", "A", "E", km)
  separates("B", "A", "C", km)

RBGL

An interface to the BOOST graph library

v1.66.0
Artistic-2.0
Authors
Vince Carey <stvjc@channing.harvard.edu>, Li Long <li.long@isb-sib.ch>, R. Gentleman
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.