src/main/java/org/thegalactic/dgraph/ConcreteDGraph.java
public void complementary() {
        for (Node<N> source : this.nodes) {
            TreeSet<Node<N>> newSuccessors = new TreeSet<Node<N>>(this.nodes);
            newSuccessors.removeAll(this.getSuccessorNodes(source));
            TreeSet<Node<N>> oldSuccessors = new TreeSet<Node<N>>(this.getSuccessorNodes(source));
            for (Node<N> target : oldSuccessors) {
                this.removeEdge(source, target);
            }
            for (Node<N> target : newSuccessors) {
                this.addEdge(source, target);
            }
        }
    }
/**
     * Replaces this component by its complementary graph.
     *
     * There is an edge between to nodes in the complementary graph when there
     * is no edges between the nodes in this component.
     */
Replaces this component by its complementary graph.
There is an edge between to nodes in the complementary graph when there
is no edges between the nodes in this component.
Replaces this component by its complementary graph . There is an edge between to nodes in the complementary graph when there is no edges between the nodes in this component .
public void complementary() {
        for (Node<N> source : this.nodes) {
            TreeSet<Node<N>> newSuccessors = new TreeSet<Node<N>>(this.nodes);
            newSuccessors.removeAll(this.getSuccessorNodes(source));
            TreeSet<Node<N>> oldSuccessors = new TreeSet<Node<N>>(this.getSuccessorNodes(source));
            for (Node<N> target : oldSuccessors) {
                this.removeEdge(source, target);
            }
            for (Node<N> target : newSuccessors) {
                this.addEdge(source, target);
            }
        }
    }
public void complementary ( ) { for ( Node < N > source : this . nodes ) { TreeSet < Node < N > > newSuccessors = new TreeSet < Node < N > > ( this . nodes ) ; newSuccessors . removeAll ( this . getSuccessorNodes ( source ) ) ; TreeSet < Node < N > > oldSuccessors = new TreeSet < Node < N > > ( this . getSuccessorNodes ( source ) ) ; for ( Node < N > target : oldSuccessors ) { this . removeEdge ( source , target ) ; } for ( Node < N > target : newSuccessors ) { this . addEdge ( source , target ) ; } } }
Replaces this component by its complementary graph.
Replaces this component by its complementary graph .