# Problem in Routing Algortithm?

**URL:** <https://ask.openrouteservice.org/t/problem-in-routing-algortithm/3331>\
**Category:** openrouteservice\
**Created:** [November 19, 2021, 10:27am UTC](https://ask.openrouteservice.org/t/problem-in-routing-algortithm/3331 "2021-11-19T10:27:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guenter-CW](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@Guenter-CW](https://ask.openrouteservice.org/u/Guenter-CW)\
**Post date:** [November 19, 2021, 10:27am UTC](https://ask.openrouteservice.org/t/problem-in-routing-algortithm/3331/1 "2021-11-19T10:27:40Z")

</div>

as an OpenStreetMap user and mapper I have found a note pointing to the following pronlem:  
The routing by OpenRouteService creates an illegal U turn:

```
https://classic-maps.openrouteservice.org/directions?n1=48.702597&n2=8.964295&n3=16&a=48.701291,8.968045,48.700175,8.960544&b=4a&c=0&k1=en-US&k2=km

```

The OpenStreetMap database seems to be correct, other routing systems correctly route via Mühlackerstraße.

The OpenRouteService routing is correct when I add the preference maxspeed = 100 km/h:

```
https://classic-maps.openrouteservice.org/directions?n1=48.706228&n2=8.959243&n3=15&a=48.701291,8.968045,48.700175,8.960544&b=4a&c=0&d=100&k1=en-US&k2=km

```

This looks like a problem in the algorithm.  
Any idea how the OSM database can be improved in order to circumvent this issue?

---

<div class="post-metadata">

**Author:** ![andrzej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/andrzej/32/10_2.png) [@andrzej](https://ask.openrouteservice.org/u/andrzej)\
**Post date:** [November 19, 2021, 2:01pm UTC](https://ask.openrouteservice.org/t/problem-in-routing-algortithm/3331/2 "2021-11-19T14:01:08Z")

</div>

Thanks for reaching out!

The observed behavior is caused by the fact that without any additional filters or settings such as `maxspeed` a routing algorithm which does not support turn restrictions is used. With some additional options active the routing is performed with a slower algorithm which takes turn restrictions into account. Another possibility to circumvent the issue is, apart from setting `maxpeed`, activating one of the avoidables such as `ferries`.

---

<div class="post-metadata">

**Author:** ![Guenter-CW](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@Guenter-CW](https://ask.openrouteservice.org/u/Guenter-CW)\
**Post date:** [November 19, 2021, 9:27pm UTC](https://ask.openrouteservice.org/t/problem-in-routing-algortithm/3331/3 "2021-11-19T21:27:50Z")

</div>

Thanks so much, ANdrzej, for your fast and clear reply! It has helped me to understand the issue.

Intuitivela, I would expect that any route created by the routing algorithm is a legal route respecting the turn restrictions.

Do you think there was a conscious design decision to tolerate violations of turn restrictions?  
Is this the right forum to discuss this requirement?
