Exemplo n.º 1
0
        private void показатьРаскраскуГрафаНаОригинальномИзображенииToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AMatrix = new int[V.Count, V.Count];
            G.fillAdjacencyMatrix(V.Count, E, AMatrix);
            selectButton.Enabled     = true;
            drawVertexButton.Enabled = true;
            drawEdgeButton.Enabled   = true;
            deleteButton.Enabled     = true;
            //Vtmp = new List<Vertex>(V);
            //Etmp = new List<Edge>(E);
            V.Clear();
            E.Clear();
            G.clearSheet();
            sheet.Image = G.GetBitmap();

            this.E = new List <Edge>(Etmp);
            this.V = new List <Vertex>(Vtmp);

            SqMatrix M = new SqMatrix(AMatrix);

            g = new Graphs(M);
            Vectors v = g.GetColouring();

            for (int i = 0; i < V.Count; i++)
            {
                V[i].color = (int)v[i];
            }
            G.drawALLGraph(V, E);
        }
Exemplo n.º 2
0
        private void показатьРаскраскуГрафаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //пока расположить вершины на окружности
            AMatrix = new int[V.Count, V.Count];
            G.fillAdjacencyMatrix(V.Count, E, AMatrix);
            selectButton.Enabled     = true;
            drawVertexButton.Enabled = true;
            drawEdgeButton.Enabled   = true;
            deleteButton.Enabled     = true;
            //Vtmp = new List<Vertex>(V);
            //Etmp = new List<Edge>(E);
            //V.Clear();
            //E.Clear();
            G.clearSheet();
            sheet.Image = G.GetBitmap();

            SqMatrix M = new SqMatrix(AMatrix);

            g      = new Graphs(M);
            this.V = new List <Vertex>(g.Ver);

            Vectors v = g.GetColouring();

            for (int i = 0; i < V.Count; i++)
            {
                V[i].color = (int)v[i];
            }

            this.E = new List <Edge>(g.Ed);
            G.drawThisGraph(g);
        }