Search in sources :

Example 1 with Graph

use of org.drools.beliefs.graph.Graph in project drools by kiegroup.

the class JunctionTreeBuilderTest method testEliminationCandidate2.

@Test
public void testEliminationCandidate2() {
    Graph graph = new BayesNetwork();
    GraphNode x0 = addNode(graph);
    GraphNode x1 = addNode(graph);
    GraphNode x2 = addNode(graph);
    GraphNode x3 = addNode(graph);
    GraphNode x4 = addNode(graph);
    connectParentToChildren(x1, x2, x3, x4);
    connectParentToChildren(x3, x4);
    JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder(graph);
    jtBuilder.moralize();
    EliminationCandidate vt1 = new EliminationCandidate(graph, jtBuilder.getAdjacencyMatrix(), x1);
    assertEquals(2, vt1.getNewEdgesRequired());
    assertEquals(bitSet("11110"), vt1.getCliqueBitSit());
}
Also used : Graph(org.drools.beliefs.graph.Graph) GraphNode(org.drools.beliefs.graph.GraphNode) Test(org.junit.Test)

Aggregations

Graph (org.drools.beliefs.graph.Graph)1 GraphNode (org.drools.beliefs.graph.GraphNode)1 Test (org.junit.Test)1