Class AStar

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class AStar : public NetworKit::STSP

Public Functions

inline AStar(const Graph &G, const std::vector<double> &distanceHeu, node source, node target, bool storePred = true)

Creates the AStarGeneral class for the graph G, the source node source, and the target node target using a template parameter as heuristic function.

Parameters:
  • G – The graph.

  • distanceHeuVector with a lower bound of the distance from every node to the target.

  • source – The source node.

  • target – The target node.

  • storePred – If true, the algorithm will also store the predecessors and reconstruct a shortest path from source and target.

inline virtual void run() override

The generic run method which calls runImpl() and takes care of setting hasRun to the appropriate value.

inline virtual std::vector<node> getPath() const override

Returns a shortest path from the source node to the target node (without including them). Note: the shortest path can be constructed only if the algorithm is executed with storePred set to true.

Returns:

A shortest path from the source to target.