Consumer/Produce Power Network with A*


#1

Hello,

I have implemented A* pathfinding project with my GOAP engine and it’s so far been worth every penny. Definitely the best asset I have ever purchased on the store and will help me scale my simulation game.

I have been wondering if it is possible to use the a* algorithm with a producer/consumer network. In this case a network would be made of produces and consumers in a non-directed graph. Consumers would produce a value the the producer… produces. I can imagine using a* to iterate through the producer nodes and find connected consumers with a multi-target path. The aspect I cannot see a clear resolution to is updating the specific producers/consumers when an edit is made the network e.g. two nodes in the graph that were once connected become disconnected. Is there a simple way in the project to achieve this? Also if anyone has any suggestions for doing this system from end to end that would be great.

Thank you,

Alex


#2

Hi

This is possible I suppose. You can create nodes easily using the PointGraph.AddNode method (https://arongranberg.com/astar/docs/pointgraph.html#AddNode), but at this point maybe it’s easier to use a custom A* (or even Dijkstra) algorithm? Assuming the power network is not so large that you need a high performance algorithm.


#3

Hi Aron,

Thanks for the response - I think you are right. A custom A* might be more applicable.

Thanks,

Alex