atofigh / edmonds-alg

Implementation of maximum branching algorithm (max spanning tree in directed graphs)
MIT License
25 stars 4 forks source link

No result when weights are negatives #1

Open Sousouam opened 6 years ago

Sousouam commented 6 years ago

I try to test this implementation of Edmond's algorithm but I get an empty result when edge weights are negatives (Ex : -10, -3 ...) Are there any default values to fix before using such weights ?

atofigh commented 6 years ago

If the template parameter TOptimumIsMaximum is true, then the optimal solution when all edge weights are negative is to chose no edge at all. On the other hand, if you want a solution with the least total weight, try setting TOptimumIsMaximum to false.