protected Edge FindEdge(Vertix begin, Vertix end)
 {
     foreach (var i in Edges)
     {
         if (i.Begin == begin && i.End == end)
         {
             return(i);
         }
     }
     return(null);
 }
 protected bool ExistsEdge(Vertix begin, Vertix end)
 {
     foreach (var i in Edges)
     {
         if (i.Begin == begin && i.End == end)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #3
0
 private void Canvas_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         Vertix v = InRadius(e);
         if (v != null)
         {
             v.Location = e.Location;
             Invalidate();
         }
     }
 }
Exemple #4
0
 public WeightedEdge(Vertix begin, Vertix end, int weight)
     : base(begin, end)
 {
     Weight = weight;
 }
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="begin">
 /// Первая вершина
 /// </param>
 /// <param name="end">
 /// Вторая вершина
 /// </param>
 public Edge(Vertix begin, Vertix end)
 {
     Begin = begin;
     End   = end;
 }
Exemple #6
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="begin">
 /// Начало ребра
 /// </param>
 /// <param name="end">
 /// Конец ребра
 /// </param>
 public OrientedEdge(Vertix begin, Vertix end) : base(begin, end)
 {
 }
Exemple #7
0
 public EdgeWithFlow(Vertix begin, Vertix end, int weight, int flow)
     : base(begin, end)
 {
     Flow   = flow;
     Weight = weight;
 }