Ejemplo n.º 1
0
 public bool Contains(BidirectionalEdge <T> edge)
 {
     if (Links.Count == 0)
     {
         return(false);
     }
     if ((Start.Equals(edge.A) && Links[0].Target.Equals(edge.B)) ||
         (Start.Equals(edge.B) && Links[0].Target.Equals(edge.A)))
     {
         return(true);
     }
     for (int i = 0; i < Links.Count - 1; i++)
     {
         if (Links[i].Target.Equals(edge.A) && Links[i + 1].Target.Equals(edge.B))
         {
             return(true);
         }
         if (Links[i].Target.Equals(edge.B) && Links[i + 1].Target.Equals(edge.A))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool Equals(BidirectionalEdge <T> other)
 {
     return((A.Equals(other.A) || A.Equals(other.B)) &&
            (B.Equals(other.A) || B.Equals(other.B)));
 }