119 (*m_predecessor)[target] =
nullptr;
147 for (
node v = target; v != source;) {
151 edge e = (*m_predecessor)[v];
155 node w = e->opposite(v);
168 edge e = adj->theEdge();
174 (*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.
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.
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.
Dynamic arrays indexed with edges.
void init()
Reinitializes the array. Associates the array with no graph.
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).
Dynamic arrays indexed with nodes.
void init()
Reinitializes the array. Associates the array with no graph.
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 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.
NodeElement * node
The type of nodes.
EdgeElement * edge
The type of edges.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.