microsoft / Graphormer

Graphormer is a general-purpose deep learning backbone for molecular modeling.
MIT License
2k stars 324 forks source link

Bugfix: Stop Floyd-Warshall algorithm dropping node 0 from paths #119

Closed jndean closed 2 years ago

jndean commented 2 years ago

The current Floyd-Warshall path-finding algorithm uses 0 as padding, but 0 is also a valid node index. This causes a bug where paths returned from get_all_edges will never contain node 0, and instead will be short. E.g. a path that should go [3, 2, 0, 5, 6] will instead return a shorter path [3, 2, 5, 6], meaning that some of the edge features are fetched incorrectly.