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;
245 edge eG = adj->theEdge();
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]) {
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;
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
Class for adjacency list elements.
Class for the representation of edges.
node target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
Data type for general directed graphs (adjacency list representation).
virtual void clear()
Removes all nodes and all edges from the graph.
node newNode(int index=-1)
Creates a new node and returns it.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
static void call(const Graph &G, Graph &SG, const node &nG, node &nSG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG, const EdgeArray< T > &edgeLengthG, EdgeArray< T > &edgeLengthSG)
Computes a connected subgraph SG of G containing node nG.
static void recursion(Graph &SG, NodeArray< bool > &nodeVisited, EdgeArray< bool > &edgeVisited, const node &nG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG, const EdgeArray< T > &edgeLengthG, EdgeArray< T > &edgeLengthSG, NodeArray< node > &nSG_to_nG, EdgeArray< edge > &eSG_to_eG, NodeArray< node > &nG_to_nSG, EdgeArray< edge > &eG_to_eSG)
Copies to SG node nG and recursively all adjacent edges and nodes.
static void call(const Graph &G, Graph &SG, const node &nG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG, const EdgeArray< T > &edgeLengthG, EdgeArray< T > &edgeLengthSG)
Computes a connected subgraph SG of G containing node nG.
static void call(const Graph &G, Graph &SG, const node &nG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG)
Computes a connected subgraph SG of G containing node nG.
static void call(const Graph &G, Graph &SG, const node &nG, node &nSG, NodeArray< node > &nSG_to_nG, EdgeArray< edge > &eSG_to_eG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG, const EdgeArray< T > &edgeLengthG, EdgeArray< T > &edgeLengthSG)
Computes a connected subgraph SG of G containing node nG.
static void call(const Graph &G, Graph &SG, const node &nG, NodeArray< node > &nSG_to_nG)
Computes a connected subgraph SG of G containing node nG.
static void call(const Graph &G, Graph &SG, const node &nG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG, NodeArray< node > &nG_to_nSG)
Computes a connected subgraph SG of G containing node nG.
static void call(const Graph &G, Graph &SG, const node &nG, node &nSG, const NodeArray< T > &nodeLengthG, NodeArray< T > &nodeLengthSG)
Computes a connected subgraph SG of G containing node nG.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
The namespace for all OGDF objects.