Learn R Programming

ggm (version 2.2)

cmpGraph: The complementary graph

Description

Finds the complementary graph of an undirected graph.

Usage

cmpGraph(amat)

Arguments

amat
the adjacency matrix of an undirected graph

Value

  • the edge matrix of the complementary graph.

Details

The complementary graph of an UG is the graph that has the same set of nodes and an undirected edge connecting $i$ and $j$ whenever there is not an $(i,j)$ edge in the original UG.

References

Lauritzen, S. (1996). Graphical models. Oxford: Clarendon Press.

See Also

UG, DAG

Examples

Run this code
## A chordless four-cycle
four <- UG(~ a*b + b*d + d*e + e*a)
four
cmpGraph(four)

Run the code above in your browser using DataLab