Class GraphExtensions
- Namespace
- AlgorithmsSW.Graph
- Assembly
- AlgorithmsSW.dll
public static class GraphExtensions
- Inheritance
-
GraphExtensions
- Inherited Members
Methods
Add(IGraph, int, int)
public static void Add(this IGraph graph, int vertex0, int vertex1)
Parameters
AverageDegree(IReadOnlyGraph)
public static float AverageDegree(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraph
Returns
ContainsEdge(IReadOnlyGraph, int, int)
[ExerciseReference(4, 1, 4)]
public static bool ContainsEdge(this IReadOnlyGraph graph, int vertex1, int vertex2)
Parameters
graph
IReadOnlyGraphvertex1
intvertex2
int
Returns
GetDegree(IReadOnlyGraph, int)
public static int GetDegree(this IReadOnlyGraph graph, int vertex)
Parameters
graph
IReadOnlyGraphvertex
int
Returns
GetSelfLoopCount(IReadOnlyGraph)
public static int GetSelfLoopCount(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraph
Returns
HasParallelEdges(IReadOnlyGraph)
public static bool HasParallelEdges(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraph
Returns
HasSelfLoops(IReadOnlyGraph)
public static bool HasSelfLoops(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraph
Returns
MaxDegree(IReadOnlyGraph)
public static int MaxDegree(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraph
Returns
ToDigraph(IReadOnlyGraph)
Converts a graph to a digraph by two edges (in opposite directions) for each edge in the original graph.
public static IReadOnlyDigraph ToDigraph(this IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraphThe graph to convert.