V
- graph node typeE
- graph edge typepublic class RandomRegularGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
The algorithm for the simple case, proposed in [SW99] and extending the one for the non-simple case [W99], runs in expected $\mathcal{O}(nd^2)$ time. It has been proved in [KV03] to sample from the space of random d-regular graphs in a way which is asymptotically uniform at random when $d = \mathcal{O}(n^{1/3 - \epsilon})$.
[KV03] Kim, Jeong Han, and Van H. Vu. "Generating random regular graphs." Proceedings of the thirty-fifth annual ACM symposium on Theory of computing. ACM, 2003. [SW99] Steger, Angelika, and Nicholas C. Wormald. "Generating random regular graphs quickly." Combinatorics, Probability and Computing 8.4 (1999): 377-396. [W99] Wormald, Nicholas C. "Models of random regular graphs." London Mathematical Society Lecture Note Series (1999): 239-298.
Constructor and Description |
---|
RandomRegularGraphGenerator(int n,
int d)
Construct a new RandomRegularGraphGenerator.
|
RandomRegularGraphGenerator(int n,
int d,
long seed)
Construct a new RandomRegularGraphGenerator.
|
RandomRegularGraphGenerator(int n,
int d,
Random rng)
Construct a new RandomRegularGraphGenerator.
|
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
Map<String,V> resultMap)
Generate a random regular graph.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateGraph
public RandomRegularGraphGenerator(int n, int d)
n
- number of nodesd
- degree of nodesIllegalArgumentException
- if number of nodes is negativeIllegalArgumentException
- if degree is negativeIllegalArgumentException
- if degree is greater than number of nodesIllegalArgumentException
- if the value "n * d" is oddpublic RandomRegularGraphGenerator(int n, int d, long seed)
n
- number of nodesd
- degree of nodesseed
- seed for the random number generatorIllegalArgumentException
- if number of nodes is negativeIllegalArgumentException
- if degree is negativeIllegalArgumentException
- if degree is greater than number of nodesIllegalArgumentException
- if the value "n * d" is oddpublic RandomRegularGraphGenerator(int n, int d, Random rng)
n
- number of nodesd
- degree of nodesrng
- the random number generator to useIllegalArgumentException
- if number of nodes is negativeIllegalArgumentException
- if degree is negativeIllegalArgumentException
- if degree is greater than number of nodesIllegalArgumentException
- if the value "n * d" is oddpublic void generateGraph(Graph<V,E> target, Map<String,V> resultMap)
generateGraph
in interface GraphGenerator<V,E,V>
target
- the target graphresultMap
- the result mapIllegalArgumentException
- if target is not an undirected graphIllegalArgumentException
- if "n == d" and the graph is simpleCopyright © 2019. All rights reserved.