80 return tmp ?
tmp->opposite(v) :
nullptr;
106 processed[seed] =
true;
107 m_seedOfNode[seed] = seed;
108 m_nodeList[seed].push(seed);
111 for (
node u : G.nodes) {
114 for (v = u; !processed[v]; v = predecessor(v)) {
Declaration and implementation of ArrayBuffer class.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Dijkstra's single source shortest path algorithm.
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false, node target=nullptr, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
Dynamic arrays indexed with edges.
Class for the representation of edges.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
Computes Voronoi regions in an edge-weighted graph.
NodeArray< edge > m_predecessor
void computeVoronoiRegions(const Graph &G, const EdgeArray< T > &weights, const List< node > &seeds)
std::map< node, ArrayBuffer< node > > m_nodeList
const List< node > & m_seeds
const Graph & getGraph() const
Returns a reference to the graph the Voronoi region has been computed for.
T distance(node v) const
Returns the distance between v and its Voronoi seed.
NodeArray< node > m_seedOfNode
node predecessor(node v) const
Returns the nearest node to v on the shortest path to its Voronoi seed.
node seed(node v) const
Returns the Voronoi seed of node v.
NodeArray< T > m_distance
Voronoi(const Graph &G, const EdgeArray< T > &weights, const List< node > &seeds)
Build data structure to query Voronoi regions of edge-weighted graph G with given Voronoi seeds.
const ArrayBuffer< node > & nodesInRegion(node v) const
Returns the list of nodes in the Voronoi region of node v.
const List< node > & getSeeds() const
Returns a reference to the list of seeds the Voronoi region has been computed for.
edge predecessorEdge(node v) const
Returns the edge incident to v and its predecessor. Note that the predecessor of a terminal is nullpt...
Implementation of Dijkstra's single source shortest path algorithm.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.