/** HG: measures time needed to check a pair of huge random graphs */
  @Test
  public void testHugeGraph() {
    int n = 700;
    long time = System.currentTimeMillis();

    DirectedGraph<Integer, DefaultEdge>
        g1 = SubgraphIsomorphismTestUtils.randomGraph(n, n * n / 50, 12345),
        g2 = SubgraphIsomorphismTestUtils.randomSubgraph(g1, n / 2, 54321);

    VF2SubgraphIsomorphismInspector<Integer, DefaultEdge> vf2 =
        new VF2SubgraphIsomorphismInspector<>(g1, g2);

    assertEquals(true, vf2.isomorphismExists());

    SubgraphIsomorphismTestUtils.showLog(
        "|V1| = "
            + g1.vertexSet().size()
            + ", |E1| = "
            + g1.edgeSet().size()
            + ", |V2| = "
            + g2.vertexSet().size()
            + ", |E2| = "
            + g2.edgeSet().size()
            + " - "
            + (System.currentTimeMillis() - time)
            + "ms");
  }
 public void testZeroNodes() {
   GraphGenerator<Integer, DefaultEdge, Integer> gen =
       new GnpRandomBipartiteGraphGenerator<>(0, 0, 0.5);
   DirectedGraph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class);
   gen.generateGraph(g, new IntegerVertexFactory(), null);
   assertEquals(0, g.vertexSet().size());
   assertEquals(0, g.edgeSet().size());
 }
  public void testDirectedGraphGnp2() {
    GraphGenerator<Integer, DefaultEdge, Integer> gen =
        new GnpRandomBipartiteGraphGenerator<>(4, 4, 1.0, SEED);
    DirectedGraph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class);
    gen.generateGraph(g, new IntegerVertexFactory(), null);

    assertEquals(4 + 4, g.vertexSet().size());
    assertEquals(32, g.edgeSet().size());
  }
  public void testDirectedGraphGnp3() {
    GraphGenerator<Integer, DefaultEdge, Integer> gen =
        new GnpRandomBipartiteGraphGenerator<>(4, 4, 0.1, SEED);
    DirectedGraph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class);
    gen.generateGraph(g, new IntegerVertexFactory(), null);

    int[][] edges = {{5, 1}, {7, 3}, {3, 8}, {8, 4}};

    assertEquals(4 + 4, g.vertexSet().size());
    for (int[] e : edges) {
      assertTrue(g.containsEdge(e[0], e[1]));
    }
    assertEquals(edges.length, g.edgeSet().size());
  }