Beispiel #1
0
        private string CalculateShortestCycle(char sourceNode)
        {
            string result = "NO CYCLE";
            List <AbstractGraphPath <char> > shortestCycles = CycleCalculator.FindShortestCycle(_graph, sourceNode);

            if (shortestCycles.Any())
            {
                result = shortestCycles.First().PathWeight.ToString();
            }

            return(result);
        }