Shortest path - taking obstacles and the terrain into account

Good to see it’s working @Intuos. Admittedly, the weighting in my first post was a bit arbitrary. The definition I’ve attached below has a 0 to 1 mixer between slope and distance with some graph mappers to help with sensitivity, magnifying the penalties for steeper slopes. A value of 1 in the mixer will give you the shortest distance path.

Shortest Path - Internalised data_BW.gh (1.2 MB)

2 Likes

Thanks a lot @Brian_Washburn that’s exactly what I was hoping to achieve! You’ve earned a reference in my thesis :wink: :+1:

Hallo,
I am so happy to have “stumbled” across this topic. I am searching for the best positioning of fire exits that need to be 60m. apart from each other in a Voronoi structure, or in other words How to position points with equal distances from one another on a graph network? Is it then a graph on a graph? I will really appreciate any clues! It is for a University project and unfortunately I can’t find no one to help me solve this. Here is a link to the topic where you can find the file.
Thanks in advance for even reading this massage!

That’s very kind of you! Please make sure to reference Richard Schaffernick’s work on SpiderWeb as well.

1 Like

@Sormond I’ve taken a pass at your question on that other thread. I attempt to show how to generate catchment areas with SpiderWeb and then “optimize” them using a derivation of Llyod’s Algorithm adapted to graph networks. Instead of working purely spatially as in Lloyd’s, the centroid of the catchment in the graph network is found in each iteration.

1 Like

@AndersDeleuran hello, im a student that is trying to learn more about grasshopper. By any chance are you able to share the script to this for me to better understand it?

Hi @Leryue and welcome to the forum :slight_smile: I’m afraid not.That said, the algorithm was very simple: First interconnect all points (i.e. source/sink nodes and vertices of the occluding objects) then cull any interconnecting line that intersect an occluding object.

1 Like

Thank you Brian! Exactly the same problem I was trying to solve.

Hi Brian, can you guide me what if i need to have a unique respond with max slope specified and shortest path?i saw different algorithms but each one had some issues, i need not to use galapagos because i need to have real time changes with changing point location just like your algorithm.
Best regards!

@PeterFotiadis Your knack for addressing challenging problems is simply astounding! It’s like you have an endless hat of examples to pull from, each perfectly tailored to the situation at hand. It’s like watching a magician at work! :tophat::sparkles:

Hi @Akram.EL ,
If you want to limit the max slope, you can pre-process the graph to eliminate any segments whose slope exceeds the limit. Then use this filtered graph to find the shortest path. Note, a solution may not exist if the only way to get from start to end is through segments that exceed the maximum slope.
20231227_Shortest Path Max Slope - Internalised data_BW.gh (1.2 MB)

-Brian

3 Likes

Thanks a lot @Brian_Washburn , it’s great. As you said for some slopes there’s no path as output. I think according to topology and desired max slope we should expect to have output or not. For some point location i had path like this.


And for it i changed m value to zero.

This is old, but it came up when I was searching for some related things.

I worked on this problem awhile ago (and still do some updates) on this library “dhart” GitHub - cadop/dhart at dev . Especially with Rhino 8 have cpython, it is pretty easy to use/integrate.

One of the key points I worked on was incorporating slope in the graph generation, both as a way to remove edges and as a metric that can be used to modify they path – for accessibility.

Perhaps not-so coincidentally, I did this for my masters thesis at U. Michigan ~2011 when Karl (who is showing that slope grasshopper component) ran the MSDT program.

So summary - builds the graph for you, considers steps and slopes for edge removal and as a metric in path planning, you can select ‘obstacle’ geometry, does shortest paths, can create a visibility graph, and some more (features like fast raycasting).

There is likely some nicer ways to setup a GH file, but this was what i came up with last year to integrate the code with rhino 8


DHART_DemoGH.zip (2.6 MB)

references:

https://dl.acm.org/doi/pdf/10.5555/3390098.3390128

2 Likes