Struct Edge<TVertex>
An unweighted edge between two vertices, with value equality over the (source, target) pair.
public readonly record struct Edge<TVertex> : IEdge<TVertex>, IEquatable<Edge<TVertex>> where TVertex : notnull
Type Parameters
TVertexThe vertex type.
- Implements
-
IEdge<TVertex>IEquatable<Edge<TVertex>>
- Inherited Members
Constructors
Edge(TVertex, TVertex)
Initializes a new edge from source to target.
public Edge(TVertex source, TVertex target)
Parameters
sourceTVertexThe vertex the edge starts at.
targetTVertexThe vertex the edge ends at.
Exceptions
- ArgumentNullException
Either vertex is null.
Properties
Source
Gets the vertex the edge starts at.
public TVertex Source { get; }
Property Value
- TVertex
Target
Gets the vertex the edge ends at.
public TVertex Target { get; }
Property Value
- TVertex
Methods
Deconstruct(out TVertex, out TVertex)
Deconstructs the edge into its endpoints.
public void Deconstruct(out TVertex source, out TVertex target)
Parameters
sourceTVertexThe vertex the edge starts at.
targetTVertexThe vertex the edge ends at.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.