27#ifndef G2O_AIS_GENERAL_DIJKSTRA_HH
28#define G2O_AIS_GENERAL_DIJKSTRA_HH
31#include "Base/Headers/Dictionary.h"
32#include "hyper_graph.h"
70 friend struct HyperDijkstra;
79 g_type
_distance=std::numeric_limits<g_type>::max());
120 g_type maxDistance=std::numeric_limits< g_type >::max(),
121 g_type comparisonConditioner=1e-3,
123 g_type maxEdgeCost=std::numeric_limits< g_type >::max());
134 g_type maxDistance=std::numeric_limits< g_type >::max(),
135 g_type comparisonConditioner=1e-3,
137 g_type maxEdgeCost=std::numeric_limits< g_type >::max());
162 g_type maxEdgeCost=std::numeric_limits< g_type >::max() );
A hash-based key-value store, useful for quick associative lookups.
abstract Vertex, your types must derive from that one
Class that models a directed Hyper-Graph.
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
The primary namespace for the NDEVR SDK.
HyperGraph::HGEdge * _edge
The edge connecting parent to child.
HyperGraph::HGEdge * edge() const
Returns the connecting edge.
g_type distance() const
Returns the distance from the source vertex.
AdjacencyMapEntry(HyperGraph::HGVertex *_child=0, HyperGraph::HGVertex *_parent=0, HyperGraph::HGEdge *_edge=0, g_type _distance=std::numeric_limits< g_type >::max())
Constructs an adjacency map entry.
Set< HyperGraph::HGVertex * > & children()
Returns the mutable set of child vertices.
HyperGraph::HGVertex * parent() const
Returns the parent vertex.
const Set< HyperGraph::HGVertex * > & children() const
Returns the const set of child vertices.
HyperGraph::HGVertex * _child
The child vertex in the shortest-path tree.
HyperGraph::HGVertex * child() const
Returns the child vertex.
HyperGraph::HGVertex * _parent
The parent vertex in the shortest-path tree.
g_type _distance
Accumulated distance from the source.
Set< HyperGraph::HGVertex * > _children
Set of child vertices reachable from this entry.
Abstract cost function for weighting edges during traversal.
virtual g_type operator()(HyperGraph::HGEdge *e, HyperGraph::HGVertex *from, HyperGraph::HGVertex *to)=0
Evaluates the cost of traversing an edge between two vertices.
Action interface executed when visiting the shortest-path tree.
virtual g_type perform(HyperGraph::HGVertex *v, HyperGraph::HGVertex *vParent, HyperGraph::HGEdge *e, g_type distance)
Performs an action on a vertex in the tree with distance information.
virtual g_type perform(HyperGraph::HGVertex *v, HyperGraph::HGVertex *vParent, HyperGraph::HGEdge *e)
Performs an action on a vertex in the tree.
void reset()
Resets the adjacency map and visited set.
static void connectedSubset(Set< HyperGraph::HGVertex * > &connected, Set< HyperGraph::HGVertex * > &visited, Set< HyperGraph::HGVertex * > &startingSet, HyperGraph *g, HyperGraph::HGVertex *v, HyperDijkstra::CostFunction *cost, g_type distance, g_type comparisonConditioner, g_type maxEdgeCost=std::numeric_limits< g_type >::max())
Finds the connected subset of vertices reachable from a given vertex within a distance.
static void computeTree(AdjacencyMap &amap)
Builds the tree structure from the adjacency map.
HyperGraph * _graph
The graph being searched.
void shortestPaths(Set< HyperGraph::HGVertex * > &vset, HyperDijkstra::CostFunction *cost, g_type maxDistance=std::numeric_limits< g_type >::max(), g_type comparisonConditioner=1e-3, bool directed=false, g_type maxEdgeCost=std::numeric_limits< g_type >::max())
Computes shortest paths from a set of source vertices.
Set< HyperGraph::HGVertex * > _visited
Set of visited vertices.
static void visitAdjacencyMap(AdjacencyMap &amap, TreeAction *action, bool useDistance=false)
Visits all entries in the adjacency map using the given tree action.
Set< HyperGraph::HGVertex * > & visited()
Returns the set of visited vertices.
Dictionary< HyperGraph::HGVertex *, AdjacencyMapEntry > AdjacencyMap
Map from vertex to its adjacency entry.
AdjacencyMap _adjacencyMap
Map from vertex to adjacency entry.
AdjacencyMap & adjacencyMap()
Returns the adjacency map.
HyperDijkstra(HyperGraph *g)
Constructs a HyperDijkstra for the given graph.
HyperGraph * graph()
Returns the underlying graph.
void shortestPaths(HyperGraph::HGVertex *v, HyperDijkstra::CostFunction *cost, g_type maxDistance=std::numeric_limits< g_type >::max(), g_type comparisonConditioner=1e-3, bool directed=false, g_type maxEdgeCost=std::numeric_limits< g_type >::max())
Computes shortest paths from a single source vertex.