예제 #1
0
        private void Next_Click(object sender, EventArgs e)
        {
            if (iKruskal == rel.Count)
            {
                asignaPropiedades();
                foreach (NodoP np in grafo)
                {
                    foreach (Arista nr in np.aristas)
                    {
                        np.colorN = new SolidBrush(Color.White);
                        nr.colorA = new Pen(Color.Black, 1);
                    }
                }
                grafo.coloreate();
                tope = 0;

                Form1_Paint(this, null);
                iKruskal = 0;
            }
            if (iKruskal < rel.Count)
            {
                foreach (NodoP np in grafo)
                {
                    foreach (Arista nr in np.aristas)
                    {
                        if (nr.origen == rel[iKruskal].origen && nr.destino == rel[iKruskal].destino)
                        {
                            grafo.coloreate();
                            nr.colorA = new Pen(new SolidBrush(Color.Orange), 8);
                            break;
                        }
                    }
                }
                grafo.ImprimirGrafo(g, true);
                iKruskal++;
            }
        }