X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=mtp_graph.cc;h=8160211ca6ed0dc9c41587e46c3b72723ed349c3;hb=99d80f42d2ece6b40a5784f03994405621ceca65;hp=7167cf6c7c3179d97eb1a2b378cd7bba2bc20dcc;hpb=72a428f6024a6a3f84526020f28cfa3a200d0f24;p=mtp.git diff --git a/mtp_graph.cc b/mtp_graph.cc index 7167cf6..8160211 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -83,17 +83,6 @@ void Vertex::del_edge(Edge *e) { ////////////////////////////////////////////////////////////////////// -Path::Path(int l) { - length = l; - nodes = new int[length]; -} - -Path::~Path() { - delete[] nodes; -} - -////////////////////////////////////////////////////////////////////// - MTPGraph::MTPGraph(int nb_vertices, int nb_edges, int *from, int *to, int source, int sink) { @@ -152,17 +141,19 @@ void MTPGraph::print(ostream *os) { void MTPGraph::print_dot(ostream *os) { (*os) << "digraph {" << endl; - (*os) << " node[shape=circle];" << 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 + (*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 + (*os) << " " << e->origin_vertex->id << " -> " << e->terminal_vertex->id << " [color=gray,label=\"" << e->length << "\"];" << endl; } }