示例#1
0
        public void Run(string dotSource)
        {
            if (_countSymbolsCheckBox.Checked)
            {
                MessageBox.Show($"Read {dotSource.Length} symbol(s).");
            }

            var vertexFun = VertexFactory.Name;
            var edgeFun   = EdgeFactory <GraphXVertex> .Weighted(0);

            var graph = Graph.LoadDot(dotSource, vertexFun, edgeFun);

            _steps = new Stack <List <GraphSerializationData> >();

            if (!graph.Vertices.Any())
            {
                MessageBox.Show("Graph is empty.");
                return;
            }

            _graphArea.LogicCore.Graph = graph;
            _graphArea.GenerateGraph();
            _zoomControl.ZoomToFill();

            HighlightToRemove();

            _hasStarted  = true;
            _hasFinished = false;
        }
示例#2
0
        static public void Run(string dotSource, List <EdgeForVisualisation> e)
        {
            edges = e;
            i     = -1;

            var vertexFun = VertexFactory.Name;
            var edgeFun   = EdgeFactory <GraphXVertex> .Weighted(0);

            var graph = Graph.LoadDot(dotSource, vertexFun, edgeFun);

            if (!graph.Vertices.Any())
            {
                MessageBox.Show("Graph is empty.");
                return;
            }
            _graphArea.LogicCore.Graph = graph;
            _graphArea.GenerateGraph();
            _zoomControl.ZoomToFill();
            foreach (var i in _graphArea.EdgesList)
            {
                i.Value.Foreground = new SolidColorBrush(Colors.WhiteSmoke);
                i.Value.ShowLabel  = true;
                i.Value.ShowArrows = false;
            }
            hasStarted  = true;
            hasFinished = false;
        }
示例#3
0
        public void Run(string dotSource)
        {
            var vertexFun = VertexFactory.Name;
            var edgeFun   = EdgeFactory <GraphXVertex> .Weighted(0);

            var graph = Graph.LoadDot(dotSource, vertexFun, edgeFun);

            if (!graph.Vertices.Any())
            {
                MessageBox.Show("Graph is empty.");
                return;
            }

            _graphArea.LogicCore.Graph = graph;
            _graphArea.GenerateGraph();
            _zoomControl.ZoomToFill();
            _graphVertices = _graphArea.VertexList.ToList();

            _isHamiltonian      = true;
            _currentVertexIndex = 0;
            _threshold          = graph.VertexCount / 2.0;
        }