Package org.graph4j.generators
Class RandomUnitDiskGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomUnitDiskGenerator
Generates random unit disk graphs. A unit disk graph is a type of geometric
graph where each vertex is associated with a disk of a fixed radius. Two
vertices are connected by an edge if the Euclidean distance between them is
less than or equal to the fixed radius of the disks.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionRandomUnitDiskGenerator(int numVertices, double radius) Creates a generator for random unit disks graphs having the specified number of vertices and radius. -
Method Summary
Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
RandomUnitDiskGenerator
public RandomUnitDiskGenerator(int numVertices, double radius) Creates a generator for random unit disks graphs having the specified number of vertices and radius.- Parameters:
numVertices- number of vertices.radius- the radius of the disks must be in the interval(0,1].
-
-
Method Details
-
createGraph
Creates a random unit disk graph.- Returns:
- a random k-nearest neighbor graph.
-