Package org.graph4j.generators
Class EdgeWeightsGenerator
java.lang.Object
org.graph4j.generators.EdgeWeightsGenerator
Generates weights for the edges of a graph.
- Author:
- Cristian Frăsinaru
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconsecutiveIntegers(Graph graph) Each edge will receive a distinct weight, between0andnumEdges - 1.static voidstatic voidrandomDoubles(Graph graph, double min, double max) static voidrandomIntegers(Graph graph, int min, int max)
-
Constructor Details
-
EdgeWeightsGenerator
public EdgeWeightsGenerator()
-
-
Method Details
-
randomIntegers
- Parameters:
graph- the input graph.min- minimum weight (inclusive).max- maximum weight (inclusive).
-
consecutiveIntegers
Each edge will receive a distinct weight, between0andnumEdges - 1.- Parameters:
graph- the input graph.
-
randomDoubles
- Parameters:
graph- the input graph.min- minimum weight (inclusive).max- maximum weight (inclusive).
-
fill
- Parameters:
graph- the input graph.value- the weight of all edges.
-