class GraphGenerateProc extends BaseProc {

    RandomGraphGenerator initializeGraphGenerator(long nodeCount, long averageDegree, RandomGraphGeneratorConfig config) {
        RandomGraphGeneratorBuilder builder = RandomGraphGenerator.builder()
            .nodeCount(nodeCount)
            .averageDegree(averageDegree)
            .relationshipDistribution(config.relationshipDistribution())
            .aggregation(config.aggregation())
            .orientation(config.orientation())
            .allowSelfLoops(AllowSelfLoops.of(config.allowSelfLoops()))
            .allocationTracker(allocationTracker());
       if (config.relationshipSeed() != null) {
           builder.seed(config.relationshipSeed());
       }

        Optional<PropertyProducer> maybeProducer = getRelationshipPropertyProducer(config.relationshipProperty());
        if (maybeProducer.isPresent()) {
            builder.relationshipPropertyProducer(maybeProducer.get());
        }
        return builder.build();
    }

}