81 explicit AStarSearch(
const bool directed =
false,
const double maxGap = 1,
122 (*m_predecessor)[target] =
nullptr;
127 node v = queue.topElement();
150 for (
node v = target; v != source;) {
154 edge e = (*m_predecessor)[v];
171 edge e = adj->theEdge();
177 (*m_predecessor)[w] = e;
Compare floating point numbers with epsilons and integral numbers with normal compare operators.
Includes declaration of graph class.
Priority queue interface wrapping various heaps.
Basic declarations, included by all source files.
A-Star informed search algorithm.
PrioritizedMapQueue< node, T > NodeQueue
void investigateNode(const node v)
NodeArray< edge > * m_predecessor
const EdgeArray< T > * m_cost
NodeArray< bool > m_folded
AStarSearch(const bool directed=false, const double maxGap=1, const EpsilonTest &et=EpsilonTest())
Initializes a new A* search algorithm.
bool validatePath(const node source, const node target) const
NodeArray< T > m_distance
std::function< T(node)> m_heuristic
T call(const Graph &graph, const EdgeArray< T > &cost, const node source, const node target, NodeArray< edge > &predecessor, std::function< T(node)> heuristic=[](node) { return T(0);})
Computes the shortests path between source and target.
Class for adjacency list elements.
Class for the representation of edges.
node opposite(node v) const
Returns the adjacent node different from v.
node target() const
Returns the target node of the edge.
std::enable_if< std::is_integral< T >::value, bool >::type geq(const T &x, const T &y) const
Compare if x is GEQ to y for integral types.
std::enable_if< std::is_integral< T >::value, bool >::type less(const T &x, const T &y) const
Compare if x is LESS than y for integral types.
std::enable_if< std::is_integral< T >::value, bool >::type equal(const T &x, const T &y) const
Compare if x is EQUAL to y for integral types.
Data type for general directed graphs (adjacency list representation).
Class for the representation of nodes.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
Prioritized queue interface wrapper for heaps.
bool empty() const
Checks whether the queue is empty.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
void decrease(const E &element, const P &priority)
Decreases the priority of the given element.
bool contains(const E &element) const
Returns whether this queue contains that key.
void push(const E &element, const P &priority)
Adds a new element to the queue.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.