🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gridijkstra

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridijkstra

Python package wrapping scipy.sparse.csgraph.dijkstra with a grid-based interface

0.1
PyPI
Maintainers
1

gridijkstra

Python package wrapping scipy's dijkstra with a grid-based interface

>>> import gridijkstra
>>> import numpy as np
>>> costs = np.ones((50, 60))
>>> costs[10:15, :20] = 1e30  # np.inf also works, but is less convenient for plotting
>>> costs[20:25, 25:55] = 1e30
>>> costs[30:40, 30:40] = 1e30
>>> start = (2, 2)
>>> target = (48, 58)
>>> total_cost, path = gridijkstra.plan(costs, start, target, return_path=True)
>>> print(f'Full path length: {total_cost}')
'Full path length: 102.0'

Three use cases are shown below. See scripts/examples.ipynb for a notebook with examples

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts