An efficient polymorphic A* search implementation using templates.