mode = MODE_IPSEP;
#endif
#endif
+ else if (streq(str, "sgd"))
+ mode = MODE_SGD;
else
agerr(AGWARN,
"Illegal value %s for attribute \"mode\" in graph %s - ignored\n",
}
solve_model(g, nG);
}
+/* sgdNeato:
+ * Solve using stochastic gradient descent a la Zheng, Pawar, Goodman.
+ */
+static void sgdNeato(Agraph_t * g, int nG, int model)
+{
+ fprintf("hello, love from sgd");
+
+ if (model == MODEL_SUBSET) {
+ subset_model(g, nG);
+ } else if (model == MODEL_CIRCUIT) {
+ if (!circuit_model(g, nG)) {
+ agerr(AGWARN,
+ "graph %s is disconnected. Hence, the circuit model\n",
+ agnameof(g));
+ agerr(AGPREV,
+ "is undefined. Reverting to the shortest path model.\n");
+ agerr(AGPREV,
+ "Alternatively, consider running neato using -Gpack=true or decomposing\n");
+ agerr(AGPREV, "the graph into connected components.\n");
+ shortest_path(g, nG);
+ }
+ } else if (model == MODEL_MDS) {
+ shortest_path(g, nG);
+ mds_model(g, nG);
+ } else
+ shortest_path(g, nG);
+ initial_positions(g, nG);
+ diffeq_model(g, nG);
+ if (Verbose) {
+ fprintf(stderr, "Solving model %d iterations %d tol %f\n",
+ model, MaxIter, Epsilon);
+ start_timer();
+ }
+ solve_model(g, nG);
+}
/* neatoLayout:
* Use stress optimization to layout a single component
nG = scan_graph_mode(g, layoutMode);
if ((nG < 2) || (MaxIter < 0))
return;
- if (layoutMode)
- majorization(mg, g, nG, layoutMode, layoutModel, Ndim, MaxIter, am);
- else
+ if (layoutMode == MODE_KK)
kkNeato(g, nG, layoutModel);
+ else if (layoutMode == MODE_SGD)
+ sgdNeato(g, nG, layoutModel)
+ else
+ majorization(mg, g, nG, layoutMode, layoutModel, Ndim, MaxIter, am);
}
/* addZ;