2 #ifndef ANDRES_GRAPH_BRIDGES_HXX
3 #define ANDRES_GRAPH_BRIDGES_HXX
7 #include "subgraph.hxx"
26 template<
typename GRAPH,
typename ARRAY>
33 template<
typename GRAPH,
typename ARRAY>
41 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
49 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
58 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
67 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
77 template<
typename GRAPH>
79 depth_(graph.numberOfVertices()),
80 min_successor_depth_(graph.numberOfVertices()),
81 next_out_arc_(graph.numberOfVertices()),
82 parent_(graph.numberOfVertices()),
83 visited_(graph.numberOfVertices())
96 template<
typename GRAPH,
typename ARRAY>
118 template<
typename GRAPH,
typename ARRAY>
140 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
144 const SUBGRAPH& subgraph_mask,
149 findBridges(graph, subgraph_mask, is_bridge, buffer);
164 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
168 const SUBGRAPH& subgraph_mask,
175 for (std::size_t i = 0; i < graph.numberOfVertices(); ++i)
176 if (buffer.
parent_[i] == -2 && subgraph_mask.vertex(i))
177 findBridges(graph, subgraph_mask, i, is_bridge, buffer);
192 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
196 const SUBGRAPH& subgraph_mask,
197 std::size_t starting_vertex,
202 findBridges(graph, subgraph_mask, starting_vertex, is_bridge, buffer);
218 template<
typename GRAPH,
typename SUBGRAPH,
typename ARRAY>
222 const SUBGRAPH& subgraph_mask,
223 std::size_t starting_vertex,
230 std::stack<std::size_t> S;
232 S.push(starting_vertex);
233 buffer.
depth_[starting_vertex] = 0;
234 buffer.
parent_[starting_vertex] = -1;
253 typename GRAPH::EdgeIterator e = graph.edgesFromVertexBegin(v) + (buffer.
next_out_arc_[v] - graph.verticesFromVertexBegin(v));
261 while (buffer.
next_out_arc_[v] != graph.verticesFromVertexEnd(v))
263 typename GRAPH::EdgeIterator e = graph.edgesFromVertexBegin(v) + (buffer.
next_out_arc_[v] - graph.verticesFromVertexBegin(v));
267 !subgraph_mask.edge(*e)