Skip to content

Passing of coordinates inefficient in distance_table #1941

@TheMarex

Description

@TheMarex

Currently we use three arrays in RouteParameters to represent locations for source/destinations:

  • coordinates which contains the coordinates in the order they are passed as loc, dst or src respectively
  • is_source boolean array of size coordinates.size() that saves for each coodinate if can be used as source
  • is_destination boolean array of size coordinates.size() that saves for each coordinate if it can be used as destination

The format of boolean arrays is unfortunate because it potentially leads to inefficient StaticRTree queries that are the bottleneck for most table computations (especially in the unsymmetrical case with duplicate coordinates).

  1. is_source -> sources: Array of indices to coordinates array
  2. is_destination -> destinations: Array of indices to destinations array
  3. Adapt RouteParamters to insert indices on AddCoordinate AddSource AddDestination
  4. Adapt distance_table to use indices array instead of filling coordinate arrays
  5. Adapt many_to_many to use one coordinate array and two indices arrays.

@daniel-j-h @MoKob if you feel like taking a stab at this let me know.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions