Esempio n. 1
0
 /// <summary>
 /// Determines if this <see cref="GraphEdge"/> connects two nodes exactly in the direction provided.
 /// </summary>
 /// <param name="e">the second <see cref="GraphEdge"/></param>
 /// <returns>true if the <see cref="GraphEdge"/> connects two nodes in either direction; false otherwise</returns>
 public bool EqualsDirected(GraphEdge e)
 {
     return(From == e.From && To == e.To);
 }
Esempio n. 2
0
 /// <summary>
 /// Determines if this <see cref="GraphEdge"/> is the same as a second <see cref="GraphEdge"/>.
 /// </summary>
 /// <param name="e">the second <see cref="GraphEdge"/></param>
 /// <returns>true if the <see cref="GraphEdge"/> connects two nodes in either direction; false otherwise</returns>
 public bool EqualsUndirected(GraphEdge e)
 {
     return((From == e.From && To == e.To) || (From == e.To && To == e.From));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a new instance of <see cref="GraphEdge"/> from an existing source.
 /// </summary>
 /// <param name="edge">the edge being cloned</param>
 public GraphEdge(GraphEdge edge)
 {
     From = edge.From;
     To   = edge.To;
 }