Support pick n shortests routes in Cost Matrix

Open
#2,509 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, postgresql
Domain
backend, databases

Research direction

Look at the existing Cost Matrix functions in the codebase, likely in src/ directory, to understand how one-to-many routing is implemented. Examine the bidirectional optimization mentioned. The goal is to modify the matrix function to accept a parameter 'n' and return the n shortest routes, preserving performance. Testing will involve comparing results against repeated one-to-many calls.

Written by the indexing model from the issue text.

Description

Functionality Request

Hi all!

Problem
Actually, the Cost Matrix functions does not support pick the n shortests routes, the only option is go down one level and use for example one to multi.

Improvement
Add a param to be able to choose the n min paths!

Alternatives
Is possible, to run this collect all the n routes using the n to multi functions, but there is some tricky things about it, actually for bidirectional case, calc the route from a to b, is the same as b to a, due to this, the matrix cost can handle better performance, while if we run one by one the one to multi this improvement is not done.

Thx!

Dominant language
C++
Stars
1.4k
Forks
397
Avg merge
2d 16h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pgRouting/pgrouting

All issues in pgRouting/pgrouting

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.