Class EdgeWeightsGenerator

java.lang.Object
org.graph4j.generators.EdgeWeightsGenerator

public class EdgeWeightsGenerator extends Object
Generates weights for the edges of a graph.
Author:
Cristian Frăsinaru
See Also:
  • Constructor Details

    • EdgeWeightsGenerator

      public EdgeWeightsGenerator()
  • Method Details

    • randomIntegers

      public static void randomIntegers(Graph graph, int min, int max)
      Parameters:
      graph - the input graph.
      min - minimum weight (inclusive).
      max - maximum weight (inclusive).
    • consecutiveIntegers

      public static void consecutiveIntegers(Graph graph)
      Each edge will receive a distinct weight, between 0 and numEdges - 1.
      Parameters:
      graph - the input graph.
    • randomDoubles

      public static void randomDoubles(Graph graph, double min, double max)
      Parameters:
      graph - the input graph.
      min - minimum weight (inclusive).
      max - maximum weight (inclusive).
    • fill

      public static void fill(Graph graph, double value)
      Parameters:
      graph - the input graph.
      value - the weight of all edges.