google-deepmind/clrs

Why no directed graph for FloydWarshall, Dijkstra, BFS and BellmanFord

sigeisler opened this issue · 2 comments

Hi,

What is the reason that you chose to use undirected graphs for the algorithms mentioned in the title? As far as I see, they should all be able to support directed graphs as well.

Thanks!

Hi Simon,

Your point is correct. We chose, as a matter of preference, to write undirected generators whenever such inputs were plausible.

But there should be no restriction on making directed datasets for those tasks. We see CLRS as a dataset generator rather than a fixed dataset, and encourage experimentation on diverse input distributions.

Thanks,
Petar

Hi Petar,

thanks for the quick response and thank you for clarifying! I have not checked all generators in detail, but I think it should be basically setting the flag directed=True. I hope that I will not run into any (silent) issues, but the algorithm implementations seem general at first sight.

Simon