/**
   * What you call from thunderdome.
   *
   * <p>Assumes a set value for k, since we don't yet have an invokeGraph method that takes a graph
   * and an argument
   *
   * @param graph
   * @return
   */
  public static Graph communityDetection(Graph graph) {
    // System.out.println("communityDetection.in " + graph);

    double k = 0.01;

    Tup2DeliteArrayIntDeliteArrayInt result =
        CommunityDetection.apply(graph.getRowIndex(), graph.getColIndex(), k);

    int[] resultNodes = result._1();
    int[] resultEdges = result._2();

    for (Integer n : resultNodes) System.out.println("communityDetection.node " + n);
    for (Integer n : resultEdges) System.out.println("communityDetection.edge " + n);

    Graph graph1 = new Graph(resultNodes, resultEdges);

    // System.out.println("communityDetection.out "+ graph1);
    return graph1;
  }
  private static Tup2DeliteArrayIntDeliteArrayInt communityDetectionInternal(
      int[] nodes, int[] edges) {
    double k = 0.01;

    return CommunityDetection.apply(nodes, edges, k);
  }