private void button2_Click(object sender, EventArgs e) { Nodes grafDecart = new Nodes(3, 3,true); graf2 = new Graph(grafDecart); VisualGraph drawGraf = new VisualGraph(10,10,panel2); drawGraf.paintGraf(graf2); if (graf2 != null && graf2 != null) { groupBox2.Enabled = true; checkBoxList(); } else { groupBox2.Enabled = false; } }
private void дейкстераToolStripMenuItem_Click(object sender, EventArgs e) { grafResult = grafResult.setWith(graf1); grafResult.algoritmDeikster(Convert.ToInt32(textBox2.Text)); VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); label6.Text = "Algorithm Deikstera"; }
private void флойдаToolStripMenuItem_Click(object sender, EventArgs e) { grafResult = graf1.setWith(graf1); grafResult.algoritmFloid(); VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); label6.Text = "algorithm Floida"; }
private void label5_Click(object sender, EventArgs e) { VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); }
private void grafUnionButton_Click(object sender, EventArgs e) { label1.Text =Convert.ToString( graf1.getCountPoint(graf2.getGrafDecart())); grafResult = graf1 + graf2; VisualGraph drawGraf = new VisualGraph(10, 10,panel3); drawGraf.paintGraf(grafResult); label6.Text = "Union graf №1 and graf №2"; }
/// <summary> /// Сведение /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void grafContractionButton_Click(object sender, EventArgs e) { if (comboBox1.Text == "Graf №1") { grafResult = grafResult.setWith( graf1); label6.Text = "Addition graf №1 "; List<int> buf = new List<int>(); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i)) { buf.Add(Convert.ToInt32(checkedListBox1.Items[i])); } } grafResult = grafResult.contraction(grafResult, buf); } else { grafResult = grafResult.setWith(graf2); label6.Text = "Addition graf №2 "; } VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); }
private void grafConnectionButton_Click(object sender, EventArgs e) { if (label2.Text == "1->2") { grafResult = graf1 * graf2; label6.Text = "Connection graf №1 with graf №2"; } else { grafResult = graf2 * graf1; label6.Text = "Connection graf №2 with graf №1"; } VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); }
private void grafAdditionButton_Click(object sender, EventArgs e) { if (comboBox1.Text == "Graf №1") { grafResult = grafResult .setWith( graf1); grafResult++; label6.Text = "Addition graf №1 "; } else { grafResult = grafResult.setWith(graf2); grafResult++; label6.Text = "Addition graf №2 "; } VisualGraph drawGraf = new VisualGraph(10, 10, panel3); drawGraf.paintGraf(grafResult); }