Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreMatrix returns null as durations #1855

Open
1 task done
mohammad-babaei opened this issue Oct 1, 2024 · 4 comments
Open
1 task done

CoreMatrix returns null as durations #1855

mohammad-babaei opened this issue Oct 1, 2024 · 4 comments
Labels
bug 🐞 Erroneous behavior of the backend investigate 🔍 matrix 🔢

Comments

@mohammad-babaei
Copy link

mohammad-babaei commented Oct 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Where did you encounter this issue?

self-hosted instance

Request URL

http://localhost:8080/ors/v2/matrix/driving-car/json

POST Request Body

{
    "locations": [
        [
            51.40108388764645,
            35.71356951328444
        ],
        [
            51.40761078866774,
            35.720287886540945
        ],
        [
            51.42363602188439,
            35.720676986229435
        ],
        [
            51.43465263873796,
            35.70920069102276
        ],
        [
            51.42399284883916,
            35.70384959916653
        ],
        [
            51.40696910180182,
            35.70385172520926
        ]
    ],
    "sources": [
        1
    ],
    "destinations": [
        3,
        4,
        5
    ],
    "metrics": [
        "duration"
    ],
    "options": {
        "dynamic_speeds": true
    }
}

Response

Response
{
    "metadata": {
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "service": "matrix",
        "timestamp": 1727785570989,
        "query": {
            "locations": [
                [
                    51.40108388764645,
                    35.71356951328444
                ],
                [
                    51.40761078866774,
                    35.720287886540945
                ],
                [
                    51.42363602188439,
                    35.720676986229435
                ],
                [
                    51.43465263873796,
                    35.70920069102276
                ],
                [
                    51.42399284883916,
                    35.70384959916653
                ],
                [
                    51.40696910180182,
                    35.70385172520926
                ]
            ],
            "profile": "driving-car",
            "responseType": "json",
            "sources": [
                "1"
            ],
            "destinations": [
                "3",
                "4",
                "5"
            ],
            "metrics": [
                "duration"
            ],
            "options": {
                "dynamic_speeds": true
            }
        },
        "engine": {
            "version": "8.2.1",
            "build_date": "2024-09-30T09:13:38Z",
            "graph_date": null
        }
    },
    "durations": [
        [
            null,
            null,
            null
        ]
    ],
    "destinations": [
        {
            "location": [
                51.434501,
                35.708999
            ],
            "snapped_distance": 26.3
        },
        {
            "location": [
                51.423992,
                35.703781
            ],
            "snapped_distance": 7.64
        },
        {
            "location": [
                51.4067,
                35.70452
            ],
            "snapped_distance": 78.14
        }
    ],
    "sources": [
        {
            "location": [
                51.407625,
                35.720403
            ],
            "snapped_distance": 12.87
        }
    ]
}

Current behavior

in DijkstraManyToMany, In updateTarget function; the targetmap never gets filled because no node in targetSet is visited. Using algorithms like simple Dijkstra this problem does not happen and we have a response with meaningful response. i have tried a lot of locations and it never works the way it has to.

Expected behavior

have numbers as durations

Openrouteservice Version

8.2.1

Build date

No response

Graph date

No response

Forum Topic Link

No response

@aoles
Copy link
Member

aoles commented Oct 1, 2024

Thanks for reporting this!

The observed behavior might be related to #1785.

Please note that the core matrix implementation is currently considered as experimental, which is the reason why it is not enabled in the public API (see also #1164).

However, there are currently ongoing efforts towards finalizing the implementation and making core matrix production-ready, so stay tuned 📣

@aoles aoles added bug 🐞 Erroneous behavior of the backend matrix 🔢 investigate 🔍 and removed api labels Oct 1, 2024
@aoles
Copy link
Member

aoles commented Oct 1, 2024

After some further investigation this issue doesn't seem to be related to #1785, as a query without the dynamic_speeds parameter succeeds. However, when I tried to reproduce the example above with ORS public API I've run into the error
[6020] Unable to compute a distance/duration matrix: Search exceeds the limit of visited nodes.

@mohammad-babaei What is the configuration setting for maximum_visited_nodes on your self-hosted instance?

@mohammad-babaei
Copy link
Author

mohammad-babaei commented Oct 1, 2024

Hi @aoles
I have set maximum_visited_nodes = 10000000 and maximum_search_radius: 20000 so that i don't get that error you mentioned. I was able to give some locations that produce some of duration records.
in this request body for example:

{
    "locations": [
        [
            51.444049483897004,
            35.666960593546776
        ],
        [
            51.443619344276584,
            35.68891637256898
        ],
        [
            51.41894048682505,
            35.70543424794617
        ],
        [
            51.36860255214674,
            35.690512280992365
        ]
    ],
    "sources": [
        0
    ],
    "destinations": [
        1,
        2,
        3
    ],
    "metrics": [
        "duration"
    ],
    "options": {
        "dynamic_speeds": true
    }
}

the result is this:

{
    "metadata": {
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "service": "matrix",
        "timestamp": 1727800180112,
        "query": {
            "locations": [
                [
                    51.444049483897004,
                    35.666960593546776
                ],
                [
                    51.443619344276584,
                    35.68891637256898
                ],
                [
                    51.41894048682505,
                    35.70543424794617
                ],
                [
                    51.36860255214674,
                    35.690512280992365
                ]
            ],
            "profile": "driving-car",
            "responseType": "json",
            "sources": [
                "0"
            ],
            "destinations": [
                "1",
                "2",
                "3"
            ],
            "metrics": [
                "duration"
            ],
            "options": {
                "dynamic_speeds": true
            }
        },
        "engine": {
            "version": "8.2.1",
            "build_date": "2024-09-30T09:13:38Z",
            "graph_date": null
        }
    },
    "durations": [
        [
            null,
            null,
            862.7
        ]
    ],
    "destinations": [
        {
            "location": [
                51.443641,
                35.688964
            ],
            "snapped_distance": 5.67
        },
        {
            "location": [
                51.418948,
                35.705367
            ],
            "snapped_distance": 7.55
        },
        {
            "location": [
                51.368591,
                35.690617
            ],
            "snapped_distance": 11.7
        }
    ],
    "sources": [
        {
            "location": [
                51.444039,
                35.666848
            ],
            "snapped_distance": 12.6
        }
    ]
}

After debugging i noticed that the prioQueue gets empty before some target nodes are visited; if it was because of disconnected subgraphs, i wonder why the request without CoreMatrix algo works fine

@aoles
Copy link
Member

aoles commented Oct 2, 2024

Thanks for your feedback!

The ORS team will look into the issue and get back to you soon.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Erroneous behavior of the backend investigate 🔍 matrix 🔢
Projects
None yet
Development

No branches or pull requests

2 participants