Beispiel #1
0
        protected override GraphAlgorithmResult PerformAlgorithm(GraphAlgorithmParameters parameters)
        {
            var graph = parameters.Graph;

            var eulerianPath = GraphAlgorithms.EulerianPath(graph);

            var stringResult = eulerianPath == null
                ? "Граф не содержит эйлеров путь"
                : $"Эйлеров путь:\n{string.Join("\n", eulerianPath)}";

            var result = new GraphAlgorithmResult(edges: eulerianPath?.ToArray(), stringResult: stringResult, isSequential: true);

            return(result);
        }