Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i=0; i<n; i++)
- for (int j=i+1; j<n; j++) {
- graph_traits<Graph>::out_edge_iterator e_start, e_end,
- e_start2, e_end2;;
- boost::tie(e_start, e_end) = boost::edge_range(i,j,g);
- // check if an edge exists
- if (e_start == e_end) continue;
- boost::tie(e_start2, e_end2) = boost::edge_range(j,i,g);
- // set reverse edge, set its capacity to be zero
- g[*e_start].rev = *(--e_end2);
- g[*e_start2].rev = *(--e_end);
- g[*e_start].capacity = xval[i][j];
- g[*e_start].res_capacity = xval[i][j];
- g[*e_start2].capacity = xval[i][j];
- g[*e_start2].res_capacity = xval[i][j];
- // now end points to the second parallel edge
- g[*e_end].capacity = 0;
- g[*e_end].res_capacity = 0;
- g[*e_end2].capacity = 0;
- g[*e_end2].res_capacity = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement