justcoding121 / advanced-algorithms

100+ algorithms & data structures generically implemented in C#
MIT License
1.3k stars 289 forks source link

Non weighted graph algorithms on weighted graphs #28

Closed JanPalasek closed 5 years ago

JanPalasek commented 5 years ago

Hi, I need to perform Tarjan strongly components finding algorithm on a weighted directed graph. Is there any way to do that, except for manually trying to convert one graph to another? Thanks.

justcoding121 commented 5 years ago

I don't think there is a way to do this without converting. I will try to update the graph algorithms to be generic enough to accept all types of graphs.

justcoding121 commented 5 years ago

Updated beta to accept generic a graph interface. If you pass a Weighted DiGraph, it will use OutEdges to run the algorithm.