65 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
90 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG,
91 nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
116 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nodeLengthG,
117 nodeLengthSG, edgeLengthG, edgeLengthSG);
135 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG);
157 call(G, SG, nG, nSG, nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
186 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG, nodeLengthG,
187 nodeLengthSG, edgeLengthG, edgeLengthSG);
254 call(G, SG, nG, nSG, nSG_to_nG, eSG_to_eG, nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG);
308 nodeLengthSG[nSG] = nodeLengthG[nG];
311 nodeVisited[nG] =
true;
315 if (!nodeVisited[eG->
source()])
317 nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG,
318 nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
319 else if (!nodeVisited[eG->
target()])
321 nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG,
322 nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
323 if (!edgeVisited[eG])
325 edge eSG = SG.
newEdge(nG_to_nSG[eG->source()], nG_to_nSG[eG->target()]);
326 edgeLengthSG[eSG] = edgeLengthG[eG];
329 edgeVisited[eG] =
true;
358 bool* nodeVisited =
new bool[n];
359 bool* edgeVisited =
new bool[m];
360 for (
int i = 0; i < n; i++)
361 nodeVisited[i] =
false;
362 for (
int i = 0; i < m; i++)
363 edgeVisited[i] =
false;
367 nodeLengthSG.
init(SG);
368 edgeLengthSG.
init(SG);
372 recursion(SG, nodeVisited, edgeVisited, nG,
373 nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG,
374 nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
378 delete[] nodeVisited;
379 delete[] edgeVisited;
402 nodeVisited[i] =
false;
404 edgeVisited[i] =
false;
415 recursion(SG, nodeVisited, edgeVisited, nG,
416 nodeLengthG, nodeLengthSG, edgeLengthG, edgeLengthSG,
417 nSG_to_nG, eSG_to_eG, nG_to_nSG, eG_to_eSG);
420 delete[] nodeVisited;
421 delete[] edgeVisited;
node target() const
Returns the target node of the edge.
edge theEdge() const
Returns the edge associated with this adjacency entry.
virtual void clear()
Removes all nodes and all edges from the graph.
void init()
Reinitializes the array. Associates the array with no graph.
Data type for general directed graphs (adjacency list representation).
void init()
Reinitializes the array. Associates the array with no graph.
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.
Dynamic arrays indexed with edges.
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 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.
int numberOfEdges() const
Returns the number of edges in the graph.
Dynamic arrays indexed with nodes.
Declaration and implementation of EdgeArray class.
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.
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.
edge newEdge(node v, node w)
Creates a new edge (v,w) and returns it.
Class for the representation of edges.
Class for the representation of nodes.
Declaration and implementation of NodeArray class.
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.
node source() const
Returns the source node of the edge.
The namespace for all OGDF objects.
int numberOfNodes() const
Returns the number of nodes in the graph.
node newNode()
Creates a new node and returns it.
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 call(const Graph &G, Graph &SG, const node &nG, NodeArray< node > &nSG_to_nG)
Computes a connected subgraph SG of G containing node nG.
Class for adjacency list elements.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.