-
-
Notifications
You must be signed in to change notification settings - Fork 71
Edges
While a vertex could be any type with QuikGraph, the edge type must implement IEdge<TVertex>
(and comply to it's contract). QuikGraph comes with various default implementations:
- Classes
-
Edge<TVertex>
, a vanilla implementation, -
EquatableEdge<TVertex>
, implementsIEquatable<EquatableEdge<TVertex>>
onSource
andTarget
, -
TaggedEdge<TVertex, TTag>
, it's anEdge<TVertex>
that also holds an additional tag information, -
EquatableTaggedEdge<TVertex, TTag>
, it's anEquatableEdge<TVertex>
that also holds an additional tag information,
-
- Structures
-
SEdge<TVertex>
, an immutable edge, -
SEquatableEdge<TVertex>
, implementsIEquatable<SEquatableEdge<TVertex>>
onSource
andTarget
, -
STaggedEdge<TVertex, TTag>
, edge that also holds an additional tag information, -
SEquatableTaggedEdge<TVertex, TTag>
, equatable edge that also holds an additional tag information, -
SReversedEdge<TVertex, TEdge>
, implementation that is reversing an edgeSource
andTarget
,
-
The struct
based edge will provide better performance and should be used when you do not plan to use custom edges.
Tagged edges implement ITagged<TTag>
, a tag is basically an additional information put on an edge and can represent anything (for example a cost associated to the edge, etc).
Of course, you can always implement your own version IEdge<TVertex>
that will better fit your needs.
In undirected graphs, the order of the source or target vertices should not matter. In order to improve efficiency, edges that implement the IUndirectedEdge<TVertex>
interface must sort the vertices so that Source <= Target
(with respect to the default Comparer).
This provides some performance gains in various data structures and algorithms.
- Classes
-
UndirectedEdge<TVertex>
, an vanilla implementation, -
TaggedUndirectedEdge<TVertex, TTag>
, it's anUndirectedEdge<TVertex>
that also holds an additional tag information,
-
- Structures
-
SUndirectedEdge<TVertex>
, an immutable edge, -
STaggedUndirectedEdge<TVertex, TTag>
, undirected edge that also holds an additional tag information
-