Query a graph

Share:

Description

queryg is a general function for querying a graph object, specifically graphs as created with newug and newdag.

Usage

1
querygraph(object, op, set = NULL, set2 = NULL, set3 = NULL)

Arguments

object

A graph object; i.e. either an unidrected graph (ugsh) or a directed acyclic graph (dagsh)

op

The query operation, see 'details' below.

set,set2,set3

Possible arguments to a graph query of type type

Details

The op can be:

  • adj: Nodes adjacant to set

  • an: Ancestors of set

  • ancestralGraph: Ancestral graph induced by set

  • ancestralSet: Ancestral set of set

  • cl: Closure of set

  • ch: Children of set

  • maxClique: The cliques

  • connectedComp The connected components

  • edges: Edges of graph

  • ne: Neighbours of set

  • nodes: Nodes of graph

  • is.complete:

  • edgeList

  • vpar

  • is.simplicial:

  • is.triangulated:

  • pa: Parents of set

  • separates: Is set and set2 separated by set3

  • simplicialNodes: The simplicial nodes of graph

  • subgraph: Subgraph induced by set

Value

Depending on the type, the output will be either a new graph or a vector or a list.

Author(s)

S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk

See Also

ug, dag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
ug0 <- ug(~a:b, ~b:c:d, ~e)

querygraph(ug0, "nodes")
querygraph(ug0, "edges")

querygraph(ug0, "subgraph", c("b","c","d","e"))

querygraph(ug0, "adj", "c")
querygraph(ug0, "closure", "c") 
querygraph(ug0, "is.simplicial", "b")
querygraph(ug0, "simplicialNodes")

querygraph(ug0, "is.complete")
querygraph(ug0, "is.complete", c("b","c","d"))
querygraph(ug0, "maxClique")

querygraph(ug0, "is.triangulated")
querygraph(ug0, "is.decomposition", "a","d",c("b","c"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.