dfs_cutval(GD_nlist(G), NULL);
}
-static void feasible_tree(void)
+static int feasible_tree(void)
{
int i, delta;
node_t *n;
fprintf(stderr, "\t%s\n", n->name);
}
#endif
- abort();
+ return 1;
}
}
init_cutvalues();
+ return 0;
}
/* walk up from v to LCA(v,w), setting new cutvalues. */
* Out and in edges lists stored in ND_out and ND_in, even if the node
* doesn't have any out or in edges.
* The node rank values are stored in ND_rank.
+ * Returns 0 if successful; returns 1 if not, the latter indicating that
+ * the graph was not connected.
*/
-void rank(graph_t * g, int balance, int maxiter)
+int rank(graph_t * g, int balance, int maxiter)
{
int iter = 0, feasible;
char *s, *ns = "network simplex: ";
else
Search_size = SEARCHSIZE;
- feasible_tree();
+ if (feasible_tree()) return 1;
while ((e = leave_edge())) {
f = enter_edge(e);
update(e, f);
fprintf(stderr, "%s%d nodes %d edges %d iter %.2f sec\n",
ns, N_nodes, N_edges, iter, elapsed_sec());
}
+ return 0;
}
/* set cut value of f, assuming values of edges on one side were already set */
extern point pointof(int, int);
extern int processClusterEdges(graph_t * g);
extern char *ps_string(char *s);
- extern void rank(graph_t * g, int balance, int maxiter);
+ extern int rank(graph_t * g, int balance, int maxiter);
extern void routesplinesinit(void);
extern point *routesplines(path *, int *);
extern void routesplinesterm(void);