Alp?r javaslat?ra k?sz?tettem egy strukt?r?t 2 dimenzi?s vektorok (s?kvektorok) t?rol?s?ra. Olyasmiket tud, amiket s?kvektorokt?l szeretn?nk. A neve: xy, a hasonl? nevu .h file-ban tal?lhat?.
11 template<typename Graph, typename CapacityMap>
12 void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) {
21 typename Graph::Edge e;
22 std::vector<typename Graph::Node> nodes;
31 case 'p': //problem definition
32 is >> problem >> n >> m;
35 for (int k=1; k<=n; ++k) nodes[k]=G.addNode();
37 case 'n': //node definition
38 if (problem=="sp") { //shortest path problem
43 if (problem=="max") { //max flow problem
46 if (d=='s') s=nodes[i];
47 if (d=='t') t=nodes[i];
53 e=G.addEdge(nodes[i], nodes[j]);