/**
  * Check whether the subgraph of <code>graph</code> induced by the given <code>vertices</code> is
  * complete, i.e. a clique.
  *
  * @param graph the graph.
  * @param vertices the vertices to induce the subgraph from.
  * @return true if the induced subgraph is a clique.
  */
 private static <V, E> boolean isClique(UndirectedGraph<V, E> graph, Set<V> vertices) {
   for (V v1 : vertices) {
     for (V v2 : vertices) {
       if ((v1 != v2) && (graph.getEdge(v1, v2) == null)) {
         return false;
       }
     }
   }
   return true;
 }