google-deepmind / graph_nets

Build Graph Nets in Tensorflow
https://arxiv.org/abs/1806.01261
Apache License 2.0
5.36k stars 782 forks source link

Inference - shortest path demo #142

Closed amnt23 closed 2 years ago

amnt23 commented 3 years ago

Question about inference in the shortest path demo: suppose that I have a dataset composed by graphs with weighted edges and I want to find the shortest path between two nodes. How can I use the trained model to do it?

alvarosg commented 3 years ago

Thanks for your message. In the example the distance between the nodes is used in a way as the "weight" of the edge, as you want to avoid edges with longer distances to find the shortest path. So instead of using distances you could use your definition of weight to let the network take this into account.