86 return m_predecessor[v];
93 return tmp ? tmp->
opposite(v) :
nullptr;
105 return m_seedOfNode[v];
111 return m_nodeList.find(
seed(v))->second;
126 processed[
seed] =
true;
139 for (
node passedNode : foundNodes) {
Dijkstra's single source shortest path algorithm.
const List< node > & getSeeds() const
Returns a reference to the list of seeds the Voronoi region has been computed for.
Data type for general directed graphs (adjacency list representation).
Declaration and implementation of ArrayBuffer class.
NodeArray< node > m_seedOfNode
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false)
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
void push(E e)
Puts a new element in the buffer.
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
Dynamic arrays indexed with edges.
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...
void computeVoronoiRegions(const Graph &G, const EdgeArray< T > &weights, const List< node > &seeds)
Computes Voronoi regions in an edge-weighted graph.
Dynamic arrays indexed with nodes.
Implementation of Dijkstra's single source shortest path algorithm.
const ArrayBuffer< node > & nodesInRegion(node v) const
Returns the list of nodes in the Voronoi region of node v.
const List< node > & m_seeds
Doubly linked lists (maintaining the length of the list).
node seed(node v) const
Returns the Voronoi seed of node v.
const Graph & getGraph() const
Returns a reference to the graph the Voronoi region has been computed for.
Class for the representation of edges.
std::map< node, ArrayBuffer< node > > m_nodeList
T distance(node v) const
Returns the distance between v and its Voronoi seed.
NodeArray< edge > m_predecessor
Class for the representation of nodes.
node opposite(node v) const
Returns the adjacent node different from v.
node predecessor(node v) const
Returns the nearest node to v on the shortest path to its Voronoi seed.
NodeArray< T > m_distance
The namespace for all OGDF objects.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
edge predecessorEdge(node v) const
Returns the edge incident to v and its predecessor. Note that the predecessor of a terminal is nullpt...