示例#1
0
 //вычисление вершин окружностей
 void calcVert(double rad)
 {
     for (int i = 0; i < ArrVertex.Count(); i++)
     {
         GraphV[i] = new GraphVertex((rad * Math.Sin(i * 2 * Math.PI / ArrVertex.Count()) + pictureBox.Width / 2) - VertRad, (rad * Math.Cos(i * 2 * Math.PI / ArrVertex.Count()) + pictureBox.Height / 2) - VertRad);
     }
 }
示例#2
0
 public Edge(GraphVertex v1, GraphVertex v2, double weight)
 {
     //координаты и вес
     this.v1 = v1;
     this.v2 = v2;
     this.w  = weight;
 }
示例#3
0
 private bool isBackEdge(GraphVertex v1, GraphVertex v2)
 {
     for (int i = 0; i < Edges.Count(); i++)
     {
         if (Edges[i].v1.x == v2.x && Edges[i].v1.y == v2.y && Edges[i].v2.x == v1.x && Edges[i].v2.y == v1.y)
         {
             return(true);
         }
     }
     return(false);
 }
示例#4
0
 public Edge(double x1, double y1, double x2, double y2, double weight)
 {
     this.v1 = new GraphVertex(x1, y1);
     this.v2 = new GraphVertex(x2, y2);
     this.w  = weight;
 }