コード例 #1
0
 protected Edge FindEdge(Vertix begin, Vertix end)
 {
     foreach (var i in Edges)
     {
         if (i.Begin == begin && i.End == end)
         {
             return(i);
         }
     }
     return(null);
 }
コード例 #2
0
 protected bool ExistsEdge(Vertix begin, Vertix end)
 {
     foreach (var i in Edges)
     {
         if (i.Begin == begin && i.End == end)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #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();
         }
     }
 }
コード例 #4
0
 public WeightedEdge(Vertix begin, Vertix end, int weight)
     : base(begin, end)
 {
     Weight = weight;
 }
コード例 #5
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="begin">
 /// Первая вершина
 /// </param>
 /// <param name="end">
 /// Вторая вершина
 /// </param>
 public Edge(Vertix begin, Vertix end)
 {
     Begin = begin;
     End   = end;
 }
コード例 #6
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="begin">
 /// Начало ребра
 /// </param>
 /// <param name="end">
 /// Конец ребра
 /// </param>
 public OrientedEdge(Vertix begin, Vertix end) : base(begin, end)
 {
 }
コード例 #7
0
 public EdgeWithFlow(Vertix begin, Vertix end, int weight, int flow)
     : base(begin, end)
 {
     Flow   = flow;
     Weight = weight;
 }