Beispiel #1
0
        public void ButtonClick(object sender, EventArgs e)
        {
            if (cycles == null)
            {
                DrawCycle();

                drawForm.Refresh();
            }
            else
            {
                ClearCycle();

                colors = new List <BrushColor> {
                    BrushColor.Green, BrushColor.Orange, BrushColor.Yellow
                };

                drawForm.Refresh();
            }
        }
Beispiel #2
0
        private void DrawPath(int start, int end, InfoTextLabel infoText)
        {
            WeightedGraph weightedGraph = new WeightedGraph(adList);

            path = weightedGraph.FindShortestPath(start, end);

            if (SumWeightPath(path) == 0)
            {
                infoText.Text = "Path: is not exist";
            }
            else
            {
                infoText.Text += Convert.ToString(SumWeightPath(path));
            }

            ChangeColorEdges(BrushColor.Yellow);

            drawForm.Refresh();
        }