Repository navigation
Closed
Labels
Description
You can choose bidirectional A* or A* with a bit heuristic for maximum speed, increasing epsilon (weight*epsilon) in the weight estimation.
The area is Saxony with none-CH car routing:
| algorithm | epsilon | av. query / ms | av. dist / km | av. visited node |
|---|---|---|---|---|
| A* | 1 | 92.2 | 110.81 | 104K |
| A* | 1.5 | 50.5 | 110.69 | 56K |
| A* | 2 | 31.7 | 109.4 | 30K |
| bidir Dijkstra | - | 83.9 | 110.81 | 111K |
(A* uses astar.approximation=BeelineSimplification)
The bidirectional case of A* (with astarbi.approximation=BeelineSimplification) is 40% faster and shows nice behaviour for epsilon < 1.8:
| algorithm | epsilon | av. query / ms | av. dist / km | av. visited node |
|---|---|---|---|---|
| bidir A* | 1 | 65.4 | 110.81 | 57K |
| bidir A* | 1.8 | 34.7 | 110.82 | 29K |
| bidir A* | 2 | 29.1 | 110.65 | 25K |
But for CH the A* is not better and the 'epsilon speedup' is not measurable (still always the risc of heuristical results):
| algorithm | epsilon | av. query / ms | av. dist / km | av. visited node |
|---|---|---|---|---|
| bidir Dijkstra CH | - | 2.02 | 104.1 | 291 |
| bidir A* CH | 1 | 2.17 | 104.1 | 287 |
| bidir A* CH | 1.8 | 1.90 | 104.1 | 287 |
| bidir A* CH | 2 | 2.11 | 104.1 | 287 |
TODOs
- measure the weight instead of the average distance as suboptimal "fastest weighting" results could be shorter and also longer
Notes:
- Which means accepting a bit heuristics your queries could get dramatically faster.
- Take care when introducing heuristics and keep this in mind as the returned route is not necessarily optimal (but for small epsilons it cannot be longer than
epsilon*real_weight) - Using
astar(bi).approximation=BeelineAccuratemakes the query roughly 25 to 30% slower - bidir Dijkstra is faster than A* with simple distance measurement, even faster than bidir A* with accurate distance measurement. And that although more nodes are traversed as the distance measurement is expensive.
- differences within 5% can be measurement errors etc
Activity
devemux86 commentedon Aug 24, 2015
Thanks @karussell, very interesting analysis.
karussell commentedon Aug 24, 2015
I'll update the main entry with new findings and numbers. Also keep in mind that the absolute numbers are kind of none sense as they are done on my laptop and no server CPU.
introducing heuristical epsilon for A* approximation, see #506
allow astarbi.epsilon for alternative routes too. epsilon seems to be…