sknw icon indicating copy to clipboard operation
sknw copied to clipboard

How to do Find Path?

Open StefanBaar opened this issue 4 years ago • 2 comments

The example in the Readme file shows an example for finding a path between selected nodes, but there is no description. How can I find the pixel between two nodes or more nodes?

StefanBaar avatar Feb 05 '21 02:02 StefanBaar

@StefanBaar hi, you can see the draw demo. sknw return a networkx object, which has some nodes and edges. path = graph[n1][n2] (normal graph) and path = graph[n1][n2][i] (multi graph), then path['pts'] is the pixels on the edge. graph.nodes()[i] is the node, and graph.nodes()[i]['o'] is the node's centriod.

and you can use sknw 's function to find the shortest path between two nodes.

yxdragon avatar Feb 13 '21 06:02 yxdragon

hello! where is the draw demo, is it the main of the script? i do not see any dijkstra/ astar call to networkx

etienne87 avatar May 22 '24 08:05 etienne87