Or-tools: DijkstraShortestPath directly in python

Created on 22 Nov 2019  Â·  5Comments  Â·  Source: google/or-tools

Hey folks,

i'm trying to use a shortest path algorithm in python. I found your library and the method DijkstraShortestPath described in:
https://github.com/google/or-tools/blob/6755c61315c7bb382a558b27cdff7ea2d5970c9c/ortools/graph/shortestpaths.h#L31-L39

Is there a way to use the algorithm directly in python? Maybe with an short code example?

My probem till now is the following:
TypeError: in method 'DijkstraShortestPath', argument 4 of type 'std::function< int64 (int,int) >'

Im not sure what to pass in argument "graph".

Thanks for help!
Timo

Feature Request Help Needed Python

Most helpful comment

@TimoK93 I would advice against that.

It's better to use a native Python library dedicated to shortest path calculation or implementing it yourself

All 5 comments

You want to use OR-tools solely for computing the shortest path?

Hey CervEdIn,
yes, thats what i need to do!

The quality of the implementation is really low. This is the most basic
implementation.

Le ven. 22 nov. 2019 à 11:35, Timo Kaiser notifications@github.com a
écrit :

Hey CervEdIn,
yes, thats what i need to do!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1734?email_source=notifications&email_token=ACUPL3PE7ZOJHAMJ4LX5YBDQU6YXRA5CNFSM4JQOLTGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE5H3NQ#issuecomment-557481398,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3IL5CCRSTHSVFPQCEDQU6YXRANCNFSM4JQOLTGA
.

@TimoK93 I would advice against that.

It's better to use a native Python library dedicated to shortest path calculation or implementing it yourself

Okay thank you... I think i will implement dijkstra on myself!

Have a nice weekend!
Timo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KeremAslan picture KeremAslan  Â·  3Comments

husamrahmanh2o picture husamrahmanh2o  Â·  4Comments

CognitiveClouds-Prasad picture CognitiveClouds-Prasad  Â·  3Comments

karomad picture karomad  Â·  3Comments

unfuse picture unfuse  Â·  5Comments