- Edge *e = edges + k;
- if(e->occupied) {
- e->length = - e->length;
- e->work_length = 0;
- e->origin_vertex->del_edge(e);
- e->terminal_vertex->add_edge(e);
- Vertex *t = e->terminal_vertex;
- e->terminal_vertex = e->origin_vertex;
- e->origin_vertex = t;
- }
- }
-
- // for(Edge *e = _sink->root_edge; e; e = e->next) {
- // if(e->occupied) {
- // Edge *f = e;
- // cout << "PATH " << _sink->id;
- // while(f) {
- // cout << " " << f->terminal_vertex->id;
- // for(f = f->terminal_vertex->root_edge; f && !f->occupied; f = f->next);
- // }
- // cout << endl;
- // }
- // }
-
- // int nb_occupied = 0;
- // for(int e = 0; e < _nb_edges; e++) {
- // for(int n = 0; n < _nb_vertices; n++) {
- // Vertex *v = &vertices[n];
- // for(Edge *e = v->root_edge; e; e = e->next) {
- // if(e->occupied) nb_occupied++;
- // }
- // }
- // }
-
- for(int n = 0; n < _nb_vertices; n++) {
- Vertex *v = &vertices[n];
- for(Edge *e = v->root_edge; e; e = e->next) {
- result_edge_occupation[e->id] = e->occupied;
- }