113 } |
114 } |
114 ostream& os = (outputName.empty() ? cout : output); |
115 ostream& os = (outputName.empty() ? cout : output); |
115 |
116 |
116 if (mincostflow) { |
117 if (mincostflow) { |
117 Graph graph; |
118 Graph graph; |
118 Node s, t; |
119 DoubleNodeMap supply(graph); |
119 DoubleMap cost(graph), capacity(graph); |
120 DoubleEdgeMap lower(graph), capacity(graph), cost(graph); |
120 readDimacs(is, graph, capacity, s, t, cost); |
121 readDimacs(is, graph, supply, lower, capacity, cost); |
121 GraphWriter<Graph>(os, graph). |
122 GraphWriter<Graph>(os, graph). |
|
123 writeNodeMap("supply", supply). |
|
124 writeEdgeMap("lower", lower). |
122 writeEdgeMap("capacity", capacity). |
125 writeEdgeMap("capacity", capacity). |
123 writeNode("source", s). |
|
124 writeNode("target", t). |
|
125 writeEdgeMap("cost", cost). |
126 writeEdgeMap("cost", cost). |
126 run(); |
127 run(); |
127 } else if (maxflow) { |
128 } else if (maxflow) { |
128 Graph graph; |
129 Graph graph; |
129 Node s, t; |
130 Node s, t; |
130 DoubleMap capacity(graph); |
131 DoubleEdgeMap capacity(graph); |
131 readDimacs(is, graph, capacity, s, t); |
132 readDimacs(is, graph, capacity, s, t); |
132 GraphWriter<Graph>(os, graph). |
133 GraphWriter<Graph>(os, graph). |
133 writeEdgeMap("capacity", capacity). |
134 writeEdgeMap("capacity", capacity). |
134 writeNode("source", s). |
135 writeNode("source", s). |
135 writeNode("target", t). |
136 writeNode("target", t). |
136 run(); |
137 run(); |
137 } else if (shortestpath) { |
138 } else if (shortestpath) { |
138 Graph graph; |
139 Graph graph; |
139 Node s; |
140 Node s; |
140 DoubleMap capacity(graph); |
141 DoubleEdgeMap capacity(graph); |
141 readDimacs(is, graph, capacity, s); |
142 readDimacs(is, graph, capacity, s); |
142 GraphWriter<Graph>(os, graph). |
143 GraphWriter<Graph>(os, graph). |
143 writeEdgeMap("capacity", capacity). |
144 writeEdgeMap("capacity", capacity). |
144 writeNode("source", s). |
145 writeNode("source", s). |
145 run(); |
146 run(); |
146 } else if (capacitated) { |
147 } else if (capacitated) { |
147 Graph graph; |
148 Graph graph; |
148 DoubleMap capacity(graph); |
149 DoubleEdgeMap capacity(graph); |
149 readDimacs(is, graph, capacity); |
150 readDimacs(is, graph, capacity); |
150 GraphWriter<Graph>(os, graph). |
151 GraphWriter<Graph>(os, graph). |
151 writeEdgeMap("capacity", capacity). |
152 writeEdgeMap("capacity", capacity). |
152 run(); |
153 run(); |
153 } else if (plain) { |
154 } else if (plain) { |