+
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ if(t > 0 && entrances[l]) {
+ node_from[e] = source;
+ node_to[e] = 1 + (2 * (t + 0) + 0) * _nb_locations + l;
+ _edge_lengths[e] = 0.0;
+ e++;
+ }
+ if(t < _nb_time_steps - 1 && exits[l]) {
+ node_from[e] = 1 + (2 * (t + 0) + 1) * _nb_locations + l;
+ node_to[e] = sink;
+ _edge_lengths[e] = 0.0;
+ e++;
+ }
+ }
+ }
+
+ _graph = new MTPGraph(nb_vertices, nb_edges,
+ node_from, node_to,
+ source, sink);
+
+ delete[] node_from;
+ delete[] node_to;
+}
+
+void Tracker::print_graph_dot(ostream *os) {
+ int e = 0;
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ _edge_lengths[e++] = - detection_score[t][l];
+ }
+ }
+ _graph->print_dot(os);