eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.48k stars 1.41k forks source link

tapasBerlin-routing astar is slow due to usage of districts (trac #3144) #3144

Closed behrisch closed 6 years ago

behrisch commented 7 years ago

The A* heuristic uses getDistanceTo() which always returns 0 if the origin or destination is a district edge. This effectively turns the algorithm into a Dijkstra search.

Instead, each district edge should record its geometric center and radius for computing a lower bound on distance.

Migrated from http://sumo.dlr.de/ticket/3144

{
    "status": "closed", 
    "changetime": "2017-05-31T08:41:01Z", 
    "description": "The A* heuristic uses getDistanceTo() which always returns 0 if the origin or destination is a district edge. This effectively turns the algorithm into a Dijkstra search.\n\nInstead, each district edge should record its geometric center and radius for computing a lower bound on distance.", 
    "reporter": "namdre", 
    "cc": "", 
    "resolution": "fixed", 
    "_ts": "1496220061172461", 
    "component": "tapasVEU", 
    "summary": "tapasBerlin-routing astar is slow due to usage of districts", 
    "priority": "major", 
    "keywords": "", 
    "time": "2017-05-24T15:53:46Z", 
    "milestone": "1.0.0", 
    "owner": "behrisch", 
    "type": "defect"
}
behrisch commented 7 years ago

actually:

  • geometric center of district-edge from nodes (and radius)
  • geometric center of district-edge to nodes (and radius)

to:

1495655423789687

save:

  • for taz-source edges the geometric center of the to-nodes of all edges along with the radius
  • for taz-sink edges the geometric center of the from nodes of all edges along with the raidus

the best center value would be the solution to the https://en.wikipedia.org/wiki/Smallest-circle_problem along with the radius of that circle.

The center of the bounding-box should be a sufficient approximation.

behrisch commented 7 years ago

@namdre changed type from "enhancement" to "defect"

behrisch commented 7 years ago

The A* heuristic uses getDistanceTo() which always returns 0 if the origin or destination is a district edge.

Instead, each district edge should record its geometric center and radius for computing a lower bound on distance.

to:

The A* heuristic uses getDistanceTo() which always returns 0 if the origin or destination is a district edge. This effectively turns the algorithm into a Dijkstra search.

Instead, each district edge should record its geometric center and radius for computing a lower bound on distance.

behrisch commented 7 years ago

@behrisch commented:

Wouldn't bounding boxes instead of circles do as well? (although the distance calculation takes a little bit more effort)

behrisch commented 7 years ago

@behrisch committed 46d67a0 (aka r24514): towards a better A* with taz, refs #3144

behrisch commented 7 years ago

@behrisch committed 3e60b15 (aka r24519): test for A* with taz, refs #3144

behrisch commented 7 years ago

@behrisch committed f942ce9 (aka r24521): adding A* taz test for duarouter, refs #3144, #21

behrisch commented 7 years ago