Shortest path with Python

In this example i find the shortest path using Short Walk plugin
Is there a way to find this path with python ? (20.2 KB)

You can implement networkx. Here’s a recent example:

Or implement e.g. Dijkstra’s shortest path natively. Example here:


Thanks @AndersDeleuran

I want avoid python modules.
Short walk plugin works faster and if there is no other choice i will keep using it