Esempio n. 1
0
 @Test
 public void createsTwoElementsClique() throws GraphCreationException {
   Clique clique = new Clique(2);
   TestSyntheticGraphMaker maker = new TestSyntheticGraphMaker(clique);
   clique.create(maker);
   assertEquals(2, maker.numNodes());
   assertEquals(2, maker.totalNumNodes());
   assertEquals(0, maker.get(0, 0));
   assertEquals(1, maker.get(0, 1));
   assertEquals(1, maker.get(1, 0));
   assertEquals(0, maker.get(1, 1));
 }
Esempio n. 2
0
 @Test
 public void createsTenElementsClique() throws GraphCreationException {
   Clique clique = new Clique(10);
   TestSyntheticGraphMaker maker = new TestSyntheticGraphMaker(clique);
   clique.create(maker);
   assertEquals(10, maker.numNodes());
   assertEquals(10, maker.totalNumNodes());
   for (int i = 0; i < 10; ++i) {
     for (int j = 0; j < 10; ++j) {
       assertEquals(i != j ? 1 : 0, maker.get(i, j));
     }
   }
 }