83 return tmp ? tmp->
opposite(v) :
nullptr;
104 sssp.
call(G, weights, seeds, m_predecessor, m_distance);
108 for (
node seed : seeds) {
109 processed[seed] =
true;
110 m_seedOfNode[seed] = seed;
111 m_nodeList[seed].push(seed);
114 for (
node u : G.nodes) {
117 for (v = u; !processed[v]; v = predecessor(v)) {
122 for (
node passedNode : foundNodes) {
123 m_seedOfNode[passedNode] = m_seedOfNode[v];
124 m_nodeList[m_seedOfNode[v]].push(passedNode);
Declaration and implementation of ArrayBuffer class.
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
Declaration of doubly linked lists and iterators.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
void push(E e)
Puts a new element in the buffer.
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...
Class for the representation of edges.
node opposite(node v) const
Returns the adjacent node different from v.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
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...
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
Implementation of Dijkstra's single source shortest path algorithm.
The namespace for all OGDF objects.