示例#1
0
        public void Discover_ShouldFind4SCC()
        {
            var sccProcessor = new StronglyConnectedComponents <char, int>();
            var result       = sccProcessor.Discover(_graph);

            result.Count.Should().Be(4);
        }
示例#2
0
        public void Discover_ShouldFind5LargestSCC()
        {
            var sccProcessor = new StronglyConnectedComponents <int, int>();
            var result       = sccProcessor.Discover(_graph);
            var biggestSizes = result.Select(g => g.Count())
                               .OrderByDescending(c => c)
                               .Take(5).ToList();

            biggestSizes.ForEach(Console.WriteLine);
        }