cmpGraph function

The complementary graph

The complementary graph

Finds the complementary graph of an undirected graph.

cmpGraph(amat)

Arguments

  • amat: the adjacency matrix of an undirected graph

Details

The complementary graph of an UG is the graph that has the same set of nodes and an undirected edge connecting ii and jj

whenever there is not an (i,j)(i,j) edge in the original UG.

Returns

the edge matrix of the complementary graph.

References

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

Author(s)

Giovanni M. Marchetti

See Also

UG, DAG

Examples

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