}
static void sfdpLayout(graph_t * g, spring_electrical_control ctrl,
- int hops, pointf pad)
-{
+ pointf pad) {
double *sizes;
double *pos;
Agnode_t *n;
case METHOD_STRESS:{
int maxit = 200;
double tol = 0.001;
- int weighted = TRUE;
if (!D){
D = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);/* all distance 1 */
- weighted = FALSE;
} else {
D = SparseMatrix_symmetrize_nodiag(D);
- weighted = TRUE;
- }
- if (hops > 0){
- SparseMatrix DD;
- DD = SparseMatrix_distance_matrix_khops(hops, D, weighted);
- if (Verbose){
- fprintf(stderr,"extracted a %d-neighborhood graph of %d edges from a graph of %d edges\n",
- hops, (DD->nz)/2, (D->nz/2));
- }
- SparseMatrix_delete(D);
- D = DD;
}
stress_model(Ndim, D, &pos, TRUE, maxit, tol, &flag);
{
int doAdjust;
adjust_data am;
- int hops = -1;
sfdp_init_graph(g);
doAdjust = (Ndim == 2);
ccs = ccomps(g, &ncc, 0);
if (ncc == 1) {
- sfdpLayout(g, ctrl, hops, pad);
+ sfdpLayout(g, ctrl, pad);
if (doAdjust) removeOverlapWith(g, &am);
spline_edges(g);
} else {
for (i = 0; i < ncc; i++) {
sg = ccs[i];
nodeInduce(sg);
- sfdpLayout(sg, ctrl, hops, pad);
+ sfdpLayout(sg, ctrl, pad);
if (doAdjust) removeOverlapWith(sg, &am);
setEdgeType(sg, EDGETYPE_LINE);
spline_edges(sg);