+ delete[] _vertices;
+ delete[] _edges;
+ delete[] _front;
+ delete[] _new_front;
+ for(int p = 0; p < nb_paths; p++) delete paths[p];
+ delete[] paths;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void MTPGraph::print(ostream *os) {
+ for(int k = 0; k < _nb_edges; k++) {
+ Edge *e = _edges + k;
+ (*os) << e->origin_vertex->id
+ << " -> "
+ << e->terminal_vertex->id
+ << " "
+ << e->length;
+ if(e->occupied) {
+ (*os) << " *";
+ }
+ (*os) << endl;
+ }
+}
+
+void MTPGraph::print_dot(ostream *os) {
+ (*os) << "digraph {" << endl;
+ // (*os) << " node [shape=circle];" << endl;
+ (*os) << " " << _source->id << " [peripheries=2];" << endl;
+ (*os) << " " << _sink->id << " [peripheries=2];" << endl;
+ for(int k = 0; k < _nb_edges; k++) {
+ Edge *e = _edges + k;
+ // (*os) << " " << e->origin_vertex->id << " -> " << e->terminal_vertex->id
+ // << ";"
+ // << endl;
+ if(e->occupied) {
+ (*os) << " " << e->origin_vertex->id << " -> " << e->terminal_vertex->id
+ << " [style=bold,color=black,label=\"" << e->length << "\"];" << endl;
+ } else {
+ (*os) << " " << e->origin_vertex->id << " -> " << e->terminal_vertex->id
+ << " [color=gray,label=\"" << e->length << "\"];" << endl;
+ }
+ }
+ (*os) << "}" << endl;