Пример #1
0
        protected override GraphAlgorithmResult PerformAlgorithm(GraphAlgorithmParameters parameters)
        {
            var graph = parameters.Graph;
            var edges = parameters.Edges;

            var vertices = ExampleAlgorithmCore(graph, edges);

            var result = new GraphAlgorithmResult(vertices: vertices);

            return(result);
        }
        public void PerformAlgorithmAsync(GraphAlgorithmParameters parameters)
        {
            Parameters = parameters;

            _algorithmThread = new Thread(() =>
            {
                IsPerforming = true;
                IsPerformed  = false;

                Result = PerformAlgorithm(parameters);

                AlgorithmPerformed?.Invoke(Result);

                IsPerforming = false;
                IsPerformed  = true;
            });

            _algorithmThread.Start();
        }
 protected abstract GraphAlgorithmResult PerformAlgorithm(GraphAlgorithmParameters parameters);