V
 vertex typeE
 edge typepublic class ComplementGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
More formally, let $G = (V, E)$ be a graph and let $K$ consist of all 2element subsets of $V$. Then $\overline{G} = (V, K \setminus E)$ is the complement of $G$, where $K \setminus E$ is the relative complement of $E$ in $K$. For directed graphs, the complement can be defined in the same way, as a directed graph on the same vertex set, using the set of all 2element ordered pairs of $V$ in place of the set $K$ in the formula above.
The complement is not defined for multigraphs. If a multigraph is provided as input to this generator, it will be treated as if it is a simple graph.
Constructor and Description 

ComplementGraphGenerator(Graph<V,E> graph)
Complement Graph Generator

ComplementGraphGenerator(Graph<V,E> graph,
boolean generateSelfLoops)
Complement Graph Generator.

Modifier and Type  Method and Description 

void 
generateGraph(Graph<V,E> target)
Generates the complement graph.

void 
generateGraph(Graph<V,E> target,
VertexFactory<V> vertexFactory,
Map<String,V> resultMap)
Generate a graph structure.

public ComplementGraphGenerator(Graph<V,E> graph)
graph
 input graphpublic ComplementGraphGenerator(Graph<V,E> graph, boolean generateSelfLoops)
generateSelfLoops
.graph
 input graphgenerateSelfLoops
 indicator whether self loops should be generated. If false, no
selfloops are generated, independent of whether the target graph supports selfloops.public void generateGraph(Graph<V,E> target)
target
 receives the generated edges and vertices; if this is nonempty on entry, the
result will be a disconnected graph since generated elements will not be connected to
existing elementspublic void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, Map<String,V> resultMap)
GraphGenerator
generateGraph
in interface GraphGenerator<V,E,V>
target
 receives the generated edges and vertices; if this is nonempty on entry, the
result will be a disconnected graph since generated elements will not be connected to
existing elementsvertexFactory
 called to produce new verticesresultMap
 if nonnull, receives implementationspecific mappings from String roles to
graph elements (or collections of graph elements)Copyright © 2017. All rights reserved.