Package core.Trees

Examples of core.Trees.Node


        Map<Vertex, Node> vertexCliqueMap = new HashMap<Vertex, Node>();
        CliqueTree cliqueTree = new CliqueTree();
        Vertex root = order[order.length - 1];
        ArrayList<Vertex> rootCliqueVertices = new ArrayList<Vertex>();
        rootCliqueVertices.add(root);
        Node initialClique = new Node(null, rootCliqueVertices);
        cliqueTree.addNode(initialClique);
        vertexCliqueMap.put(root, initialClique);
        for (int i = order.length - 2; i >= 0; i--) {
            Vertex x = order[i];
            ArrayList<Vertex> RNwithoutParent = new ArrayList<Vertex>(x.getRightNeighbours());
            RNwithoutParent.remove(x.getParent());
            ArrayList<Vertex> RNofParent = null;
            if (x != null && x.getParent() != null && x.getParent().getRightNeighbours() != null) {
                RNofParent = new ArrayList<Vertex>(x.getParent().getRightNeighbours());
            }
            if (!RNwithoutParent.equals(RNofParent)) {
                ArrayList<Vertex> cliqueVertices = new ArrayList<Vertex>();
                cliqueVertices.add(x);
                cliqueVertices.addAll(x.getRightNeighbours());
                Node clique = new Node(vertexCliqueMap.get(x.getParent()), cliqueVertices);
                vertexCliqueMap.put(x, clique);
                cliqueTree.addNode(clique);
            } else {
                Node parentClique = vertexCliqueMap.get(x.getParent());
                ArrayList<Vertex> cliqueVerteces = new ArrayList<Vertex>();
                boolean similarRN = false;
                for (Vertex vertex : parentClique.getData()) {
                    if (x.getRightNeighbours().equals(vertex.getRightNeighbours())) {
                        similarRN = true;
                        break;
                    } else {
                        similarRN = false;
                    }
                }
                if (similarRN == false) {
                    cliqueVerteces.add(x);
                    cliqueVerteces.addAll(parentClique.getData());
                    parentClique.setData(cliqueVerteces);
                    vertexCliqueMap.put(x, parentClique);
                } else {
                    cliqueVerteces.add(x);
                    cliqueVerteces.addAll(x.getRightNeighbours());
                    Node clique = new Node(vertexCliqueMap.get(x.getParent()), cliqueVerteces);
                    vertexCliqueMap.put(x, clique);
                    cliqueTree.addNode(clique);
                }
            }
        }
View Full Code Here


            if (pivots.size() == 0) {

//                long zeroPivotStartTime = System.nanoTime();

                ArrayList<Node> nonSingletonClass = orderedCliques.get(nonSingletonClassIndex);
                Node lastClique = nonSingletonClass.get(nonSingletonClass.size() - 1);
                ArrayList<Node> lastCliqueList = new ArrayList<Node>();
                lastCliqueList.add(lastClique);
                orderedCliques.add(nonSingletonClassIndex + 1, lastCliqueList);
                nonSingletonClass.remove(lastClique);
                l = new ArrayList<Node>();
View Full Code Here

TOP

Related Classes of core.Trees.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.