The tracker seems to work.
[mtp.git] / mtp_graph.cc
index fe74dd1..eb4d3cc 100644 (file)
@@ -236,3 +236,19 @@ void MTPGraph::find_best_paths(scalar_t *lengths, int *result_edge_occupation) {
     }
   }
 }
+
+void dot_print(int nb_vertices,
+               int nb_edges, int *ea, int *eb, scalar_t *el,
+               int source, int sink,
+               int *edge_occupation) {
+  cout << "digraph {" << endl;
+  cout << "  node[shape=circle];" << endl;
+  for(int e = 0; e < nb_edges; e++) {
+    if(edge_occupation[e]) {
+      cout << "  " << ea[e] << " -> " << eb[e] << " [style=bold,color=black,label=\"" << el[e] << "\"];" << endl;
+    } else {
+      cout << "  " << ea[e] << " -> " << eb[e] << " [color=gray,label=\"" << el[e] << "\"];" << endl;
+    }
+  }
+  cout << "}" << endl;
+}