Skip to content

Route Calculation

joelll-u edited this page Mar 7, 2024 · 1 revision

The backend provides functionality to calculate routes, in this page we will describe the algorithms behind the route calculation.

Common Setup

Both route planning algorithms work by dividing a common route into sections. This common route is defined by simply following the coastline, then we divide into sections based on the starting points i.e, slipways and beaches.

Image

Here is a diagram of an island, the red is the common route all the kayaks follow and the green are the slipways and beaches from where you can start. We then divide the route into sections based on the slipways.

Image

Point-to-point route generator

The point to point route generator works by generating routes a subset of start points. It starts by simply generating routes each one representing one section as shown above. Then the algorithm joins them iteratively, from each start point creating longer and longer routes. It then terminates once a certain number of routes has been generated and returns them in descending distance order.

Circular route generator.

The circular route generator works by randomly picking sections and finding "switchpoints" for them. i.e when the tide switches direction with respect to the route.

13:00

Image

14:00

Image

Then based on the time of this switch point begins stepping backward and forward simultaneously until it reaches a minimum distance. For each of the sections it steps over it checks that the tide is still supporting it in both the forward and back directions.

If it reaches the minimum distance without tide pushing against it, it returns the route, if not it tries another switch point, and if that doesn't work it attempts another section on which to switch.

Clone this wiki locally