graph.complementer {igraph}R Documentation

Complementer of a graph

Description

A complementer graph contains all edges that were not present in the input graph.

Usage

graph.complementer(graph, loops=FALSE)

Arguments

graph

The input graph, can be directed or undirected.

loops

Logical constant, whether to generate loop edges.

Details

graph.complementer creates the complementer of a graph. Only edges which are not present in the original graph will be included in the new graph.

graph.complementer keeps graph and vertex attriubutes, edge attributes are lost.

Value

A new graph object.

Author(s)

Gabor Csardi csardi.gabor@gmail.com

Examples

## Complementer of a ring
g <- graph.ring(10)
graph.complementer(g)

## A graph and its complementer give together the full graph
g <- graph.ring(10)
gc <- graph.complementer(g)
gu <- graph.union(g, gc)
gu
graph.isomorphic(gu, graph.full(vcount(g)))

[Package igraph version 0.7.0 Index]