Class RandomGraph
- Namespace
- AlgorithmsSW.Digraph
- Assembly
- AlgorithmsSW.dll
Generates random digraphs.
public static class RandomGraph
- Inheritance
-
RandomGraph
- Inherited Members
Methods
ErdosRenyiGraph(int, int)
Generates a graph with edges uniformly chosen from the set of all possible edges, including self-loops.
public static IDigraph ErdosRenyiGraph(int vertexCount, int edgeCount)
Parameters
vertexCount
intHow many vertexes the graph should have.
edgeCount
intHow many edges the graph should have.
Returns
- IDigraph
A random graph.
Exceptions
- ArgumentOutOfRangeException
vertexCount
oredgeCount
is not positive.
RandomSimple(int, int)
Generates a graph with edges uniformly chosen from the set of all possible edges, excluding self-loops.
public static IDigraph RandomSimple(int vertexCount, int edgeCount)
Parameters
vertexCount
intHow many vertexes the graph should have.
edgeCount
intHow many edges the graph should have.
Returns
- IDigraph
A random graph.
Exceptions
- ArgumentOutOfRangeException
vertexCount
oredgeCount
is not positive.