2k-1 approximate distance oracle More...
#include <thorup_2kminus1.hpp>
Public Member Functions | |
| distance_oracle_thorup2kminus1approximation (const Graph &g, VertexIndexMap index, EdgeWeightMap edge_weight, int k, Rand &&random_engine=Rand(5426u)) | |
| Constructor. More... | |
| DT | operator() (VT u, VT v) const |
| Returns an 2k-1 approximate distance between two vertices in O(k) time. More... | |
2k-1 approximate distance oracle
| Graph | graph |
| EdgeWeightMap | edge weight map |
| VertexIndexMap | vertex index map |
| Rand | random engine |
Definition at line 51 of file thorup_2kminus1.hpp.
|
inline |
Constructor.
| g | graph |
| index | vertex index map |
| edge_weight | edge weight map |
| k | approximation parameter |
| random_engine | random engine |
Definition at line 428 of file thorup_2kminus1.hpp.
|
inline |
Returns an 2k-1 approximate distance between two vertices in O(k) time.
Returns a distance of path going through one of parents of u or v
Returns d(v, middle) + d(middle, u)
Definition at line 448 of file thorup_2kminus1.hpp.
1.8.5