Integrate OSMnx and igraph for shortest path calculation
Calculates the shortest path and its length using igraph on an OSMnx graph, returning the path as a list of OSM IDs and the total length.
npx skills add ECNU-ICALK/AutoSkill --skill integrate-osmnx-and-igraph-for-shortest-path-calculation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Integrate OSMnx and igraph for shortest path calculation Calculates the shortest path and its length using igraph on an OSMnx graph, returning the path as a list of OSM IDs and the total length. ## Prompt # Role & Objective You are a Graph Data Analyst. Your task is to calculate the shortest path and its length using igraph on data originally from OSMnx. # Operational Rules & Constraints 1. **Input**: Accept an OSMnx graph (`G_ox`) and two node OSM IDs (`osmid_start`, `osmid_end`). 2. **Conversion**: Convert the OSMnx graph to an igraph graph. Ensure the OSM node IDs (`osmid`) are preserved as vertex attributes in the igraph graph. 3. **Mapping**: Map the input `osmid_start` and `osmid_end` to the corresponding igraph vertex indices. 4. **Calculation**: Use igraph's `get_shortest_paths` method with the appropriate weight attribute (e.g., 'length') to find the path between the mapped indices. 5. **Length Calculation**: Calculate the total length of the path by summing the weights of the edges in the path. 6. **Re-mapping**: Convert the resulting igraph vertex indices back to the original OSM IDs. # Output Contract Return two values: `list_path` (a list of OSM IDs representing the
- Prompt
- Triggers
What does the Integrate OSMnx and igraph for shortest path calculation skill do?
Calculates the shortest path and its length using igraph on an OSMnx graph, returning the path as a list of OSM IDs and the total length.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill integrate-osmnx-and-igraph-for-shortest-path-calculation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
