Need help with Grasshopper route optimisation

or a architecture college course i need to write a reseach proposal, with a data simulation model made in Grasshopper. In my research i want to make a bike route optimisation to minimize traffic noise exposure. I have to write the steps in my grasshopper script (not neccecarily create a script, just describe it with all the parameters and variables and such).

First I made a noise prediction mapping model. Here i calculated how much traffic noise (in a case study) each road (which is defined as a line with gridpoints on a seperate surface) produces and the degression of the sound level when it spreads through the area. here is a example: Dublin Noise Maps | Dublin City Air & Noise

But the final step, calculating the most optimal bike route throught already existing roads, i have no idea how to produce. I want to give as parameters a given start and end location, and let grasshopper calculate the most optimal route. I have no idea how to do this, does someone know anything?

the first thing that comes to my mind is a sort of dijkstra algorithm between start and end locations, through a grid of points that is distributed on the map, and each of those points has a weight that depends on the amount of noise

but reading the text from the link you have posted, those noise maps look like the wrong place to get data from, for a project like yours:

you are not looking for the locations where the noise is less annoying in the long term, if you are considering a bike ride that could eventually last minutes/dozens of minutes… I don’t see that as “long term” :slight_smile:

Hello
From what I understand you’ll have to find a metric that is taking into count the sound. Let say velocity is constant and we have for each portion of path (n°i)

  • level of noise
  • distance
    you must find a tool that calculate a sort of factor like for example
    Factor (path) = level of noise (dB) * distance

You can then use ShortestWalk and instead of distance use the factor, the tool will find the lowest Sum of Factors path.
https://www.food4rhino.com/en/app/shortest-walk-gh

I think I understand the scenario, but I am not sure about what you need to achieve in your task within grasshopper. My understanding is that you want a sort of pseudocode for grasshopper? If so, here are my thoughts.

  1. Getting your map data into grasshopper quantitatively: This could be done by modelling a sort of decision tree structure, so for example, we look at how many possible roads can we access from the departure point, and those are the number of branches from the start point. And at each branch we place values representing the noise. And from end of these branches look at all the route options and create branches for them with noise values as well, and so on. That is, create branches for each of the possible routes with corresponding values for noise. This goes on until every branch route terminates at the arrival point.
  2. Running the simulation: A light way to approach it is that at each decision point, with the various possible branches (representing different routes), pick the most optimal route, i.e. with lowest noise value. Repeat the process for this new decision point, and so on until you get to your destination.
  3. A problem with this approach is that the solution is unduly influenced by the earliest nodes. So, the road option from the start point with the lowest noise may lead to only road options with lots of noise, while an option with high noise at the start option, may lead to further options that are really quiet. So, the more exhaustive (and much heavier) approach is to go through all the possible routes and get the total noise for each route, and then comparing these totals at the end to find the optimal route.
  4. Once this is achieved, then maybe you want to give different weightsto different noise attributes for better decision making. Say for example, two different routes with the same total noise value, may have one route with a steady medium level noise, and the other route with some really loud points and others with really quiet points. Would you want both these routes to be assessed as being the same?
    So immediately writing out this proposal, given the possible number of combinations of routes, probably the script may get too unwieldy to work with, with visual programming alone and no coding. Maybe first simplify the map to a very minimal number of key nodes, and thus possible route combinations, for example maybe first just consider the options for moving along the major roads only. The practical logic, being that the noise from the major roads, may influence the level of noise on the roads connected to it, such that a noisy major road artery will likely also have noise sub-roads (?).
    Anyway, once you have this script with just the options for the major road, you can then, for each of these options, model all the possible sub-routes considering medium sized roads for each option. And then create sub-sub-options, for each of the sub options to whatever level of refinement is practical.
    So, you will calculate the quietest route, while only using the major routes. And for only that quietest route, run the script on its sub routes, and so on.

How to run this with actual grasshopper components. I think they may be lots of options.
Separately model every route, and sum up the total for each route
directly modelling your branches logic and comparing the values at each branch, and maybe use stream gate/ stream filter to pick best option at each node
maybe create a network of all possible road connections, and use Galapagos to iteratively go through the options.
the idea of a web structurer of routes and weights at nodes makes me think of using kangaroo, where you create a an actual (digital) web of nodes with weights, and let then let gravityfind the heaviest.