I have a network of nodes arranged on a 2D Grid
. I want to connect pairs of nodes with connections that will then occupy physical space on the 2D grid. The connections are now obstacles themselves and future connections will have to take a path that avoids intersecting them.
I am currently using the A* algorithm
and gradually building up the connection. While it finds the shortest path from start to end node, it does not consider the other connections that will need to be made, so the total path cost after connecting all the pairs is not optimal.
Does anyone know whether there is an algorithm that can solve this, or is this a NP complete problem? Any direction on related material would also be appreciated.