Class RandomUnitDiskGenerator

java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomUnitDiskGenerator

public class RandomUnitDiskGenerator extends AbstractGraphGenerator
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
  • 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

      public Graph createGraph()
      Creates a random unit disk graph.
      Returns:
      a random k-nearest neighbor graph.