@Test public void testJunctionTree() { Graph<BayesVariable> graph = new BayesNetwork(); GraphNode x0 = addNode(graph); GraphNode x1 = addNode(graph); GraphNode x2 = addNode(graph); GraphNode x3 = addNode(graph); GraphNode x4 = addNode(graph); GraphNode x5 = addNode(graph); GraphNode x6 = addNode(graph); OpenBitSet OpenBitSet1 = bitSet("00001110"); OpenBitSet OpenBitSet2 = bitSet("00011100"); OpenBitSet OpenBitSet3 = bitSet("00110000"); OpenBitSet OpenBitSet4 = bitSet("01110000"); List<OpenBitSet> cliques = new ArrayList<OpenBitSet>(); cliques.add ( OpenBitSet1 ); cliques.add ( OpenBitSet2 ); cliques.add ( OpenBitSet3 ); cliques.add ( OpenBitSet4 ); List<SeparatorSet> separatorSets = new ArrayList<SeparatorSet>(); for ( int i = 0; i < cliques.size(); i++ ) { OpenBitSet ci = cliques.get(i); for ( int j = i+1; j < cliques.size(); j++ ) { OpenBitSet cj = cliques.get(j); if ( ci.intersects( cj ) ) { SeparatorSet separatorSet = new SeparatorSet( ci, 0, cj, 0, graph ); } } } Collections.sort(separatorSets); }
public JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init) { return junctionTree(null, null, null, cliques, init); }
JunctionTreeBuilder { public JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init) { return junctionTree(null, null, null, cliques, init); } }
JunctionTreeBuilder { public JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init) { return junctionTree(null, null, null, cliques, init); } JunctionTreeBuilder(Graph<BayesVariable> graph); }
JunctionTreeBuilder { public JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init) { return junctionTree(null, null, null, cliques, init); } JunctionTreeBuilder(Graph<BayesVariable> graph); Graph<BayesVariable> getGraph(); JunctionTree build(); JunctionTree build(boolean init); JunctionTree build(Resource resource, String namespace, String name); JunctionTree build(Resource resource, String namespace, String name, boolean init); void moralize(); void moralize(GraphNode<BayesVariable> v, GraphNode v1); static void connect(boolean[][] adjMatrix, int v1, int v2); static void disconnect(boolean[][] adjMatrix, int v1, int v2); List<OpenBitSet> triangulate(); void eliminateVertex(PriorityQueue<EliminationCandidate> p, Map<Integer, EliminationCandidate> elmVertMap, boolean[][] clonedAdjMatrix, boolean[] adjList, Set<Integer> verticesToUpdate, EliminationCandidate v); void createClique(int v, boolean[][] clonedAdjMatrix, Set<Integer> verticesToUpdate, boolean[] adjList); static void updateCliques(List<OpenBitSet> cliques, OpenBitSet newClique); boolean[][] getAdjacencyMatrix(); static boolean[][] cloneAdjacencyMarix(boolean[][] src); JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init); JunctionTree junctionTree(Resource resource, String namespace, String name, List<OpenBitSet> cliques, boolean init); void mergeGraphs(SeparatorSet[][][] graphs, SeparatorSet separatorSet); int createJunctionTreeGraph(SeparatorSet[][] sepGraph, JunctionTreeClique parent, JunctionTreeClique[] jtNodes, JunctionTreeSeparator[] jtSeps, int i); void mapNodeToCliqueFamily(OpenBitSet[] varNodeToCliques, JunctionTreeClique[] jtNodes); void mapVarNodeToCliques(OpenBitSet[] nodeToCliques, int id, OpenBitSet clique); static List<Integer> getAdjacentVertices(boolean[][] adjacencyMatrix, int i); }
JunctionTreeBuilder { public JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init) { return junctionTree(null, null, null, cliques, init); } JunctionTreeBuilder(Graph<BayesVariable> graph); Graph<BayesVariable> getGraph(); JunctionTree build(); JunctionTree build(boolean init); JunctionTree build(Resource resource, String namespace, String name); JunctionTree build(Resource resource, String namespace, String name, boolean init); void moralize(); void moralize(GraphNode<BayesVariable> v, GraphNode v1); static void connect(boolean[][] adjMatrix, int v1, int v2); static void disconnect(boolean[][] adjMatrix, int v1, int v2); List<OpenBitSet> triangulate(); void eliminateVertex(PriorityQueue<EliminationCandidate> p, Map<Integer, EliminationCandidate> elmVertMap, boolean[][] clonedAdjMatrix, boolean[] adjList, Set<Integer> verticesToUpdate, EliminationCandidate v); void createClique(int v, boolean[][] clonedAdjMatrix, Set<Integer> verticesToUpdate, boolean[] adjList); static void updateCliques(List<OpenBitSet> cliques, OpenBitSet newClique); boolean[][] getAdjacencyMatrix(); static boolean[][] cloneAdjacencyMarix(boolean[][] src); JunctionTree junctionTree(List<OpenBitSet> cliques, boolean init); JunctionTree junctionTree(Resource resource, String namespace, String name, List<OpenBitSet> cliques, boolean init); void mergeGraphs(SeparatorSet[][][] graphs, SeparatorSet separatorSet); int createJunctionTreeGraph(SeparatorSet[][] sepGraph, JunctionTreeClique parent, JunctionTreeClique[] jtNodes, JunctionTreeSeparator[] jtSeps, int i); void mapNodeToCliqueFamily(OpenBitSet[] varNodeToCliques, JunctionTreeClique[] jtNodes); void mapVarNodeToCliques(OpenBitSet[] nodeToCliques, int id, OpenBitSet clique); static List<Integer> getAdjacentVertices(boolean[][] adjacencyMatrix, int i);  }