Class EdgeWeightedDigraphExtensions
- Namespace
- AlgorithmsSW.EdgeWeightedDigraph
- Assembly
- AlgorithmsSW.dll
public static class EdgeWeightedDigraphExtensions
- Inheritance
-
EdgeWeightedDigraphExtensions
- Inherited Members
-
Methods
AddEdge<TWeight>(IEdgeWeightedDigraph<TWeight>, int, int, TWeight)
public static void AddEdge<TWeight>(this IEdgeWeightedDigraph<TWeight> graph, int sourceVertex, int targetVertex, TWeight weight)
Parameters
graph
IEdgeWeightedDigraph<TWeight>
sourceVertex
int
targetVertex
int
weight
TWeight
Type Parameters
TWeight
GetUniqueEdge<TWeight>(IReadOnlyEdgeWeightedDigraph<TWeight>, int, int)
public static DirectedEdge<TWeight> GetUniqueEdge<TWeight>(this IReadOnlyEdgeWeightedDigraph<TWeight> graph, int sourceVertex, int targetVertex)
Parameters
graph
IReadOnlyEdgeWeightedDigraph<TWeight>
sourceVertex
int
targetVertex
int
Returns
- DirectedEdge<TWeight>
Type Parameters
TWeight
HasUniqueEdge<TWeight>(IReadOnlyEdgeWeightedDigraph<TWeight>, int, int)
public static bool HasUniqueEdge<TWeight>(this IReadOnlyEdgeWeightedDigraph<TWeight> graph, int pairFirst, int pairLast)
Parameters
graph
IReadOnlyEdgeWeightedDigraph<TWeight>
pairFirst
int
pairLast
int
Returns
- bool
Type Parameters
TWeight
RemoveUniqueEdge<TWeight>(IEdgeWeightedDigraph<TWeight>, int, int)
public static DirectedEdge<TWeight> RemoveUniqueEdge<TWeight>(this IEdgeWeightedDigraph<TWeight> digraph, int sourceVertex, int targetVertex)
Parameters
digraph
IEdgeWeightedDigraph<TWeight>
sourceVertex
int
targetVertex
int
Returns
- DirectedEdge<TWeight>
Type Parameters
TWeight
RemoveVertex<TWeight>(IEdgeWeightedDigraph<TWeight>, int)
public static IEnumerable<DirectedEdge<TWeight>> RemoveVertex<TWeight>(this IEdgeWeightedDigraph<TWeight> graph, int vertex)
Parameters
graph
IEdgeWeightedDigraph<TWeight>
vertex
int
Returns
- IEnumerable<DirectedEdge<TWeight>>
Type Parameters
TWeight
Reverse<TWeight>(IEdgeWeightedDigraph<TWeight>)
public static IEdgeWeightedDigraph<TWeight> Reverse<TWeight>(this IEdgeWeightedDigraph<TWeight> graph)
Parameters
graph
IEdgeWeightedDigraph<TWeight>
Returns
- IEdgeWeightedDigraph<TWeight>
Type Parameters
TWeight
ToEdgeWeightedDigraph<TWeight>(IReadOnlyDigraph, TWeight[], IComparer<TWeight>, TWeight)
[ExerciseReference(4, 4, 22)]
public static IEdgeWeightedDigraph<TWeight> ToEdgeWeightedDigraph<TWeight>(this IReadOnlyDigraph graph, TWeight[] vertexWeights, IComparer<TWeight> comparer, TWeight zero)
Parameters
graph
IReadOnlyDigraph
vertexWeights
TWeight[]
comparer
IComparer<TWeight>
zero
TWeight
Returns
- IEdgeWeightedDigraph<TWeight>
Type Parameters
TWeight
TryGetUniqueEdge<TWeight>(IReadOnlyEdgeWeightedDigraph<TWeight>, int, int, out DirectedEdge<TWeight>?)
public static EdgeExistance TryGetUniqueEdge<TWeight>(this IReadOnlyEdgeWeightedDigraph<TWeight> graph, int sourceVertex, int targetVertex, out DirectedEdge<TWeight>? edge)
Parameters
graph
IReadOnlyEdgeWeightedDigraph<TWeight>
sourceVertex
int
targetVertex
int
edge
DirectedEdge<TWeight>
Returns
- EdgeExistance
Type Parameters
TWeight