Example #1
0
        private void button3_Click_1(object sender, EventArgs e)
        {
            var weightsByPrime   = algoService.UsePrimeAlgo(V, W, new List <Weight>());
            var weightsByKruskal = algoService.UseKruskalAlgo(V, W);

            var resultWeights = weightsByPrime.Union(weightsByKruskal).ToList();
            var edges         = SynchronizeEdgesAndWeights(resultWeights);

            var dfsService = new DFSService();

            dfsService.GetAndPrintCycles(V, edges, listBoxMatrix);
            DrawGraph(V, edges, resultWeights);
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();
            V = new List <Vertex>();
            G = new DrawGraph(sheet.Width, sheet.Height);
            E = new List <Edge>();
            W = new List <Weight>();

            CurV = new List <Vertex>();
            CurW = new List <Weight>();
            CurE = new List <Edge>();

            Value         = new List <String>();
            Euler         = new List <int>();
            algoService   = new ReqAlgosService();
            matrixService = new MatrixService();
            dfsService    = new DFSService();

            sheet.Image = G.GetBitmap();
        }