]> granicus.if.org Git - graphviz/commitdiff
sfdpgen: remove unused 'maximal_independent_edge_set_heavest_edge_pernode_leaves_first'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 29 Dec 2022 19:55:39 +0000 (11:55 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 30 Dec 2022 06:46:14 +0000 (22:46 -0800)
lib/sfdpgen/Multilevel.c

index 53fb50eac867224323643e84e7348463bcaa8373..860df8b0da9a1f4b45ad48ea6054bf68d43b5e01 100644 (file)
@@ -242,114 +242,6 @@ static void maximal_independent_edge_set_heavest_edge_pernode(SparseMatrix A, in
   free(p);
 }
 
-
-
-
-
-#define node_degree(i) (ia[(i)+1] - ia[(i)])
-
-static void maximal_independent_edge_set_heavest_edge_pernode_leaves_first(SparseMatrix A, int **cluster, int **clusterp, int *ncluster){
-  int i, ii, j, *ia, *ja, m, n, *p = NULL, q;
-  (void)n;
-  double *a, amax = 0;
-  int first = TRUE, jamax = 0;
-  int *matched, nz, ncmax = 0, nz0, nzz,k ;
-  enum {MATCHED = -1};
-
-  assert(A);
-  assert(SparseMatrix_known_strucural_symmetric(A));
-  ia = A->ia;
-  ja = A->ja;
-  m = A->m;
-  n = A->n;
-  assert(n == m);
-  *cluster = gv_calloc(m, sizeof(int));
-  *clusterp = gv_calloc(m + 1, sizeof(int));
-  matched = gv_calloc(m, sizeof(int));
-
-  for (i = 0; i < m; i++) matched[i] = i;
-
-  assert(SparseMatrix_is_symmetric(A, false));
-  assert(A->type == MATRIX_TYPE_REAL);
-
-  *ncluster = 0;
-  (*clusterp)[0] = 0;
-  nz = 0;
-  a = A->a;
-  p = random_permutation(m);
-  for (ii = 0; ii < m; ii++){
-    i = p[ii];
-    if (matched[i] == MATCHED || node_degree(i) != 1) continue;
-    q = ja[ia[i]];
-    assert(matched[q] != MATCHED);
-    matched[q] = MATCHED;
-    (*cluster)[nz++] = q;
-    for (j = ia[q]; j < ia[q+1]; j++){
-      if (q == ja[j]) continue;
-      if (node_degree(ja[j]) == 1){
-        matched[ja[j]] = MATCHED;
-        (*cluster)[nz++] = ja[j];
-      }
-    }
-    ncmax = MAX(ncmax, nz - (*clusterp)[*ncluster]);
-    nz0 = (*clusterp)[*ncluster];
-    if (nz - nz0 <= MAX_CLUSTER_SIZE){
-      (*clusterp)[++(*ncluster)] = nz;
-    } else {
-      (*clusterp)[++(*ncluster)] = ++nz0;      
-      nzz = nz0;
-      for (k = nz0; k < nz && nzz < nz; k++){
-        nzz += MAX_CLUSTER_SIZE - 1;
-        nzz = MIN(nz, nzz);
-        (*clusterp)[++(*ncluster)] = nzz;
-      }
-    }
-  }
-
- #ifdef DEBUG_print
-  if (Verbose)
-    fprintf(stderr, "%d leaves and parents for %d clusters, largest cluster = %d\n",nz, *ncluster, ncmax);
-#endif
-  for (ii = 0; ii < m; ii++){
-    i = p[ii];
-    first = TRUE;
-    if (matched[i] == MATCHED) continue;
-    for (j = ia[i]; j < ia[i+1]; j++){
-      if (i == ja[j]) continue;
-      if (matched[ja[j]] != MATCHED && matched[i] != MATCHED){
-        if (first) {
-          amax = a[j];
-          jamax = ja[j];
-          first = FALSE;
-        } else {
-          if (a[j] > amax){
-            amax = a[j];
-            jamax = ja[j];
-          }
-        }
-      }
-    }
-    if (!first){
-        matched[jamax] = MATCHED;
-        matched[i] = MATCHED;
-        (*cluster)[nz++] = i;
-        (*cluster)[nz++] = jamax;
-        (*clusterp)[++(*ncluster)] = nz;
-    }
-  }
-
-  for (i = 0; i < m; i++){
-    if (matched[i] == i){
-      (*cluster)[nz++] = i;
-      (*clusterp)[++(*ncluster)] = nz;
-    }
-  }
-
-  free(p);
-
-  free(matched);
-}
-
 static void maximal_independent_edge_set_heavest_edge_pernode_supernodes_first(SparseMatrix A, int **cluster, int **clusterp, int *ncluster){
   int i, ii, j, *ia, *ja, m, n, *p = NULL;
   (void)n;