We use VRP and point to point routing for a web application. One of routes keeps generating a weird result. So, I tested a part of the route on the esri site. It shows the same strange result. On ArcGIS.com it works correctly. But the Javascript SDK for point to point or VRP both do it incorrectly.
https://developers.arcgis.com/javascript/latest/tutorials/find-a-route-and-directions/
I have attached 3 photos. The first shows the problem and the second shows the location and the third shows the same problem correctly solved in ArcGIS online. I suspect this is a systemic problem, where the routing engine thinks, making a right, U Turn and another right is faster than waiting at the intersection with a traffic light then going straight through. So, mathematically, the solution may be optimized, but obviously it is not useful for routing.
Hi @FredHejazi, thanks for posting your issue here. From the screenshots, it looks like the routing behavior may be different based on the location of the dropped pins. You might see better results if you zoom in quite close before dropping pins to ensure you have the exact desired location (and side of the road), or using addresses in the Directions component UI, or RouteLayer, or route() method.
Noah,
If you look at the screen shots, the issue is not the side of the road where the points are placed. The travel direction is from east to west. Even if one or both endpoints are on the wrong side of the street the recommended route would be still be incorrect. In fact there are no two points on the two sides of the intersection that should result in the recommended route.
It's worth noting, we are not trying to create a route across one intersection as that would make no sense. The issue came up as a part of a much longer route starting much further east at an actual address and ending much further west at another address. The rest of the route was correct. Only this part was incorrect. To submit the problem we narrowed it to just the incorrect part and we showed it on ESRI's site, so there would not be any concerns that we are implementing the technology incorrectly.