src/main/java/org/thegalactic/lattice/ClosureSystem.java
public ConcreteDGraph<Comparable, ?> precedenceGraph() {
        // compute a TreeMap of closures for each element of the component
        TreeMap<Comparable, TreeSet<Comparable>> closures = new TreeMap<Comparable, TreeSet<Comparable>>();
        for (Comparable x : this.getSet()) {
            ComparableSet setX = new ComparableSet();
            setX.add(x);
            closures.put(x, this.closure(setX));
        }
        // nodes of the graph are elements
        ConcreteDGraph<Comparable, ?> prec = new ConcreteDGraph<Comparable, Object>();
        TreeMap<Comparable, Node> nodeCreated = new TreeMap<Comparable, Node>();
        for (Comparable x : this.getSet()) {
            Node node = new Node(x);
            prec.addNode(node);
            nodeCreated.put(x, node);
        }
        // edges of the graph are closures containments
        for (Comparable source : this.getSet()) {
            for (Comparable target : this.getSet()) {
                if (!source.equals(target)) {
                    // check if source belongs to the closure of target
                    if (closures.get(target).contains(source)) {
                        prec.addEdge(nodeCreated.get(source), nodeCreated.get(target));
                    }
                }
            }
        }
        return prec;
    }
/**
     * Returns the precedence graph of this component.
     *
     * Nodes of the graph are elements of this component. There is an edge from
     * element a to element b when a belongs to the closure of b.
     *
     * The rule a -> a isn't added to the precedence graph
     *
     * When precedence graph is acyclic, then this component is a reduced one.
     *
     * @return the precedence graph
     */
Returns the precedence graph of this component.
Nodes of the graph are elements of this component. There is an edge from
element a to element b when a belongs to the closure of b.

The rule a -> a isn't added to the precedence graph

When precedence graph is acyclic, then this component is a reduced one.

@return the precedence graph
Returns the precedence graph of this component . Nodes of the graph are elements of this component . There is an edge from element a to element b when a belongs to the closure of b . The rule a - > a isn ' t added to the precedence graph When precedence graph is acyclic then this component is a reduced one . @return the precedence graph
public ConcreteDGraph<Comparable, ?> precedenceGraph() {
        TreeMap<Comparable, TreeSet<Comparable>> closures = new TreeMap<Comparable, TreeSet<Comparable>>();
        for (Comparable x : this.getSet()) {
            ComparableSet setX = new ComparableSet();
            setX.add(x);
            closures.put(x, this.closure(setX));
        }
        ConcreteDGraph<Comparable, ?> prec = new ConcreteDGraph<Comparable, Object>();
        TreeMap<Comparable, Node> nodeCreated = new TreeMap<Comparable, Node>();
        for (Comparable x : this.getSet()) {
            Node node = new Node(x);
            prec.addNode(node);
            nodeCreated.put(x, node);
        }
        for (Comparable source : this.getSet()) {
            for (Comparable target : this.getSet()) {
                if (!source.equals(target)) {
                    if (closures.get(target).contains(source)) {
                        prec.addEdge(nodeCreated.get(source), nodeCreated.get(target));
                    }
                }
            }
        }
        return prec;
    }
public ConcreteDGraph < Comparable , ? > precedenceGraph ( ) { TreeMap < Comparable , TreeSet < Comparable > > closures = new TreeMap < Comparable , TreeSet < Comparable > > ( ) ; for ( Comparable x : this . getSet ( ) ) { ComparableSet setX = new ComparableSet ( ) ; setX . add ( x ) ; closures . put ( x , this . closure ( setX ) ) ; } ConcreteDGraph < Comparable , ? > prec = new ConcreteDGraph < Comparable , Object > ( ) ; TreeMap < Comparable , Node > nodeCreated = new TreeMap < Comparable , Node > ( ) ; for ( Comparable x : this . getSet ( ) ) { Node node = new Node ( x ) ; prec . addNode ( node ) ; nodeCreated . put ( x , node ) ; } for ( Comparable source : this . getSet ( ) ) { for ( Comparable target : this . getSet ( ) ) { if ( ! source . equals ( target ) ) { if ( closures . get ( target ) . contains ( source ) ) { prec . addEdge ( nodeCreated . get ( source ) , nodeCreated . get ( target ) ) ; } } } } return prec ; }
Returns the precedence graph of this component.
Returns the precedence graph of this component .
// compute a TreeMap of closures for each element of the component // nodes of the graph are elements // edges of the graph are closures containments // check if source belongs to the closure of target