YaccConstructor / QuickGraph

Generic Graph Data Structures and Algorithms for .NET
http://yaccconstructor.github.io/QuickGraph/
Microsoft Public License
523 stars 198 forks source link

Transitive Reduction: standalone vertices are being removed from the graph #198

Open nicolas-2008 opened 4 years ago

nicolas-2008 commented 4 years ago

TransitiveReduction has an issue working with graph which contains not linked vertices.

            var graph = new BidirectionalGraph<string, Edge<string>>();
            graph.AddVertex("/test");
            graph.AddVertex("/test/123");
            graph.AddVertex("/test/notlinked");
            graph.AddEdge(new Edge<string>("/test", "/test/123"));

            var reduced = graph.ComputeTransitiveReduction();

Only two vertices are left in reduced graph.

KeRNeLith commented 4 years ago

I made a fix for this in my fork of the library (with also a lot of others fixes and .NET Core compliance). It is available in latest release (after this commit).