Пример #1
0
 @Test
 public void createsOneElementClique() throws GraphCreationException {
   Clique clique = new Clique(1);
   TestSyntheticGraphMaker maker = new TestSyntheticGraphMaker(clique);
   clique.create(maker);
   assertEquals(1, maker.numNodes());
   assertEquals(1, maker.totalNumNodes());
   assertEquals(0, maker.get(0, 0));
 }
Пример #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));
     }
   }
 }