예제 #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);
        }
예제 #2
0
        private string CalculateCyclesWithMaxWeight(char node, int maxWeight)
        {
            int count = CycleCalculator.CountAllCycles(_graph, node, maxWeight);

            return(count.ToString());
        }
예제 #3
0
        private string CalculateCycleCount(char node, int maxStops)
        {
            string result = CycleCalculator.FindAllSimpleCycles(_graph, node, maxStops).Count.ToString();

            return(result);
        }