59 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
79 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG, nodeLengthG, nodeLengthSG,
80 edgeLengthG, edgeLengthSG);
99 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nodeLengthG, nodeLengthSG, edgeLengthG,
114 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG);
130 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
151 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG, nodeLengthG, nodeLengthSG,
152 edgeLengthG, edgeLengthSG);
202 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nodeLengthG, nodeLengthSG, edgeLengthG,
239 nodeLengthSG[nSG] = nodeLengthG[nG];
242 nodeVisited[nG] =
true;
246 if (!nodeVisited[eG->
source()]) {
247 recursion(SG, nodeVisited, edgeVisited, eG->
source(), nodeLengthG, nodeLengthSG,
248 edgeLengthG, edgeLengthSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
249 }
else if (!nodeVisited[eG->
target()]) {
250 recursion(SG, nodeVisited, edgeVisited, eG->
target(), nodeLengthG, nodeLengthSG,
251 edgeLengthG, edgeLengthSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
253 if (!edgeVisited[eG]) {
254 edge eSG = SG.
newEdge(nG_to_nSG[eG->source()], nG_to_nSG[eG->target()]);
255 edgeLengthSG[eSG] = edgeLengthG[eG];
258 edgeVisited[eG] =
true;
274 const int n = G.numberOfNodes();
275 const int m = G.numberOfEdges();
277 bool* nodeVisited =
new bool[n];
278 bool* edgeVisited =
new bool[m];
279 for (
int i = 0; i < n; i++)
280 nodeVisited[i] =
false;
281 for (
int i = 0; i < m; i++)
282 edgeVisited[i] =
false;
286 nodeLengthSG.
init(SG);
287 edgeLengthSG.
init(SG);
291 recursion(SG, nodeVisited, edgeVisited, nG, nodeLengthG, nodeLengthSG, edgeLengthG,
292 edgeLengthSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
296 delete[] nodeVisited;
297 delete[] edgeVisited;
310 bool* nodeVisited =
new bool[G.numberOfNodes()];
311 bool* edgeVisited =
new bool[G.numberOfEdges()];
312 for (
int i = 0; i < G.numberOfNodes(); i++)
313 nodeVisited[i] =
false;
314 for (
int i = 0; i < G.numberOfEdges(); i++)
315 edgeVisited[i] =
false;
326 recursion(SG, nodeVisited, edgeVisited, nG, nodeLengthG, nodeLengthSG, edgeLengthG,
327 edgeLengthSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
330 delete[] nodeVisited;
331 delete[] edgeVisited;