Expression-based

Route-finding is a function which finds the shortest path through a network from a Start point to a Finish point.

Routing determines which series of links (based on individual lengths) will form the shortest path (of all possible routes from start to finish) through the network.

Other applications

In abstract terms we can replace ‘distance’ with ‘cost’ to find the ‘least-costly’ path through a network. 

Here ‘cost’ can be any quantifiable attribute of a link.

This opens many possibilities. To find the quickest path through a network, you could factor in link type, average speed and link length into the equation

For e.g. you can define 70mph for Motorways, 50mph for A-Roads, etc. and find the quickest path through an OS Highways network.

Expressions

The key to this is that the 'cost' of a link is determined by an expression.

The routing function will apply this expression to every link to determine its cost and on the basis of those costs will find the least-cost or optimal) path through the network, e.g. shortest, quickest, 'prettiest' etc.

The only imperatives are:

  • The expression must return a numeric value
  • The expression must be valid for every link in the network.