Exemplo n.º 1
0
        private void calculateFlow()
        {
            Flow f = new Flow(_graph);
            int  r = f.setMaxFlow();

            richTextBox1.Text = "Flow = " + r.ToString();
            pictureBox1.Image = GraphVisualization.getImage(_graph);
        }
Exemplo n.º 2
0
        private void runPrim()
        {
            Prim  prim  = new Prim();
            Graph primG = prim.usePrim(_graph);

            dataGridView2.DataSource = Matrix.createIncidenceMatrix(primG);
            pictureBox2.Image        = GraphVisualization.getImage(primG);
        }
Exemplo n.º 3
0
        private void postman()
        {
            lab2.Postman p = new lab2.Postman(_graph);
            pictureBox1.Image = GraphVisualization.getImage(p.WorkGraph);
            String str = "Ціна шляху = " + p.Weigth.ToString() + "\n\n";

            for (int i = 0; i < p.CycleVertex.Count; i++)
            {
                str += p.CycleVertex[i].Name + "->";
            }
            str += p.CycleVertex[0].Name + "\n\n";
            for (int i = 0; i < p.CycleEdges.Count - 1; i++)
            {
                str += p.CycleEdges[i].Name + "->";
            }
            str += p.CycleEdges[p.CycleEdges.Count - 1].Name + "\n";
            richTextBox1.Text = str;
        }
Exemplo n.º 4
0
 private void vizGraph2()
 {
     dataGridView2.DataSource = Matrix.createIncidenceMatrix(_graph2);
     pictureBox2.Image        = GraphVisualization.getImage(_graph2);
 }