src/main/java/org/thegalactic/lattice/ConceptLattice.java
public static ConceptLattice diagramLattice(ClosureSystem init) {
        ConceptLattice lattice = new ConceptLattice();
        //if (Diagram) {
        // computes the dependance graph of the closure system
        // addition of nodes in the precedence graph
        ConcreteDGraph graph = new ConcreteDGraph();
        for (Comparable c : init.getSet()) {
            graph.addNode(new Node(c));
        }
        lattice.setDependencyGraph(graph);
        // intialize the close set lattice with botom element
        Concept bot = new Concept(init.closure(new ComparableSet()), false);
        lattice.addNode(bot);
        // recursive genaration from the botom element with diagramLattice
        lattice.recursiveDiagramLattice(bot, init);
        // minimalisation of edge's content to get only inclusion-minimal valuation for each edge
        /**
         * for (Edge ed : lattice.dependanceGraph.getEdges()) {
         * TreeSet<ComparableSet> valEd = new
         * TreeSet<ComparableSet>(((TreeSet<ComparableSet>)ed.getContent()));
         * for (ComparableSet X1 : valEd) for (ComparableSet X2 : valEd) if
         * (X1.containsAll(X2) && !X2.containsAll(X1))
         * ((TreeSet<ComparableSet>)ed.getContent()).remove(X1); }*
         */
        return lattice;
    }
/**
     * Generates and returns the Hasse diagram of the closed set lattice of the
     * specified closure system, that can be an implicational system
     * (ImplicationalSystem) or a context.
     *
     * The Hasse diagramm of the closed set lattice is obtained by a recursively
     * generation of immediate successors of a given closed set, starting from
     * the botom closed set. Implemented algorithm is an adaptation of Bordat's
     * algorithm where the dependance graph is computed while the lattice is
     * generated. This treatment is performed in O(cCl|S|^3log g) where S is the
     * initial set of elements, c is the number of closed sets that could be
     * exponential in the worst case, Cl is the closure computation complexity
     * and g is the number of minimal generators of the lattice.
     *
     * The dependance graph of the lattice is also computed while the lattice
     * generation. The dependance graph of a lattice encodes at once the minimal
     * generators and the canonical direct basis of the lattice .
     *
     * @param init a closure system (an ImplicationalSystem or a Context)
     *
     * @return a concept lattice
     */
Generates and returns the Hasse diagram of the closed set lattice of the
specified closure system, that can be an implicational system
(ImplicationalSystem) or a context.

The Hasse diagramm of the closed set lattice is obtained by a recursively
generation of immediate successors of a given closed set, starting from
the botom closed set. Implemented algorithm is an adaptation of Bordat's
algorithm where the dependance graph is computed while the lattice is
generated. This treatment is performed in O(cCl|S|^3log g) where S is the
initial set of elements, c is the number of closed sets that could be
exponential in the worst case, Cl is the closure computation complexity
and g is the number of minimal generators of the lattice.

The dependance graph of the lattice is also computed while the lattice
generation. The dependance graph of a lattice encodes at once the minimal
generators and the canonical direct basis of the lattice .

@param init a closure system (an ImplicationalSystem or a Context)

@return a concept lattice
Generates and returns the Hasse diagram of the closed set lattice of the specified closure system that can be an implicational system ( ImplicationalSystem ) or a context . The Hasse diagramm of the closed set lattice is obtained by a recursively generation of immediate successors of a given closed set starting from the botom closed set . Implemented algorithm is an adaptation of Bordat ' s algorithm where the dependance graph is computed while the lattice is generated . This treatment is performed in O ( cCl|S|^3log g ) where S is the initial set of elements c is the number of closed sets that could be exponential in the worst case Cl is the closure computation complexity and g is the number of minimal generators of the lattice . The dependance graph of the lattice is also computed while the lattice generation . The dependance graph of a lattice encodes at once the minimal generators and the canonical direct basis of the lattice . @param init a closure system ( an ImplicationalSystem or a Context ) @return a concept lattice
public static ConceptLattice diagramLattice(ClosureSystem init) {
        ConceptLattice lattice = new ConceptLattice();
        ConcreteDGraph graph = new ConcreteDGraph();
        for (Comparable c : init.getSet()) {
            graph.addNode(new Node(c));
        }
        lattice.setDependencyGraph(graph);
        Concept bot = new Concept(init.closure(new ComparableSet()), false);
        lattice.addNode(bot);
        lattice.recursiveDiagramLattice(bot, init);
        /**
         * for (Edge ed : lattice.dependanceGraph.getEdges()) {
         * TreeSet<ComparableSet> valEd = new
         * TreeSet<ComparableSet>(((TreeSet<ComparableSet>)ed.getContent()));
         * for (ComparableSet X1 : valEd) for (ComparableSet X2 : valEd) if
         * (X1.containsAll(X2) && !X2.containsAll(X1))
         * ((TreeSet<ComparableSet>)ed.getContent()).remove(X1); }*
         */
        return lattice;
    }
public static ConceptLattice diagramLattice ( ClosureSystem init ) { ConceptLattice lattice = new ConceptLattice ( ) ; ConcreteDGraph graph = new ConcreteDGraph ( ) ; for ( Comparable c : init . getSet ( ) ) { graph . addNode ( new Node ( c ) ) ; } lattice . setDependencyGraph ( graph ) ; Concept bot = new Concept ( init . closure ( new ComparableSet ( ) ) , false ) ; lattice . addNode ( bot ) ; lattice . recursiveDiagramLattice ( bot , init ) ; /**
         * for (Edge ed : lattice.dependanceGraph.getEdges()) {
         * TreeSet<ComparableSet> valEd = new
         * TreeSet<ComparableSet>(((TreeSet<ComparableSet>)ed.getContent()));
         * for (ComparableSet X1 : valEd) for (ComparableSet X2 : valEd) if
         * (X1.containsAll(X2) && !X2.containsAll(X1))
         * ((TreeSet<ComparableSet>)ed.getContent()).remove(X1); }*
         */ return lattice ; }
Generates and returns the Hasse diagram of the closed set lattice of the
 specified closure system, that can be an implicational system
 (ImplicationalSystem) or a context.
Generates and returns the Hasse diagram of the closed set lattice of the specified closure system that can be an implicational system ( ImplicationalSystem ) or a context .
//if (Diagram) { // computes the dependance graph of the closure system // addition of nodes in the precedence graph // intialize the close set lattice with botom element // recursive genaration from the botom element with diagramLattice // minimalisation of edge's content to get only inclusion-minimal valuation for each edge