→The algorithm / list of conditions
1.1. In some cases, T junctions could be considered as only 2 segments. See explanation on 'T junctions' below.
2. if the angle between s-out and the best continuation is larger than 45 degrees (and less than 180), the instruction is: 'TURN RIGHT'
<br/> 2.1 One assumption is that on primary roads (minor highways, major highways and freeways), we won't have angles which are larger than 45 degrees .
3. if s-out is determined to be the best continuation of s-in (explanation on 'best continuation' below), the instruction is: 'CONTINUE'
4. if s-in is a primary road and s-out is not a primary road, the instruction is: 'EXIT RIGHT'
6. if none of the above conditions is met, the instruction is: 'KEEP RIGHT'
== T junctions and one way roads ==