girgs  1.0.2
Generator for Geometric Inhomogeneous Random Graphs
Generator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <string>
5 
6 #include <girgs/girgs_api.h>
7 
8 
9 namespace girgs {
10 
11 
26 GIRGS_API std::vector<double> generateWeights(int n, double ple, int weightSeed, bool parallel = true);
27 
42 GIRGS_API std::vector<std::vector<double>> generatePositions(int n, int dimension, int positionSeed, bool parallel = true);
43 
68 GIRGS_API double scaleWeights(std::vector<double>& weights, double desiredAvgDegree, int dimension, double alpha);
69 
87 GIRGS_API std::vector<std::pair<int,int>> generateEdges(const std::vector<double>& weights, const std::vector<std::vector<double>>& positions,
88  double alpha, int samplingSeed);
89 
90 
105 GIRGS_API void saveDot(const std::vector<double>& weights, const std::vector<std::vector<double>>& positions,
106  const std::vector<std::pair<int,int>> &graph, const std::string &file);
107 
108 
109 
110 } // namespace girgs
Definition: Generator.h:9
GIRGS_API std::vector< double > generateWeights(int n, double ple, int weightSeed, bool parallel=true)
The weights are sampled according to a power law distribution between [1, n)
GIRGS_API std::vector< std::vector< double > > generatePositions(int n, int dimension, int positionSeed, bool parallel=true)
Samples d dimensional coordinates for n points on a torus .
GIRGS_API std::vector< std::pair< int, int > > generateEdges(const std::vector< double > &weights, const std::vector< std::vector< double >> &positions, double alpha, int samplingSeed)
Samples edges according to weights and positions. An edge between node u and v is formed with probabi...
GIRGS_API double scaleWeights(std::vector< double > &weights, double desiredAvgDegree, int dimension, double alpha)
Scales all weights so that the expected average degree equals desiredAvgDegree. Implemented as binary...
GIRGS_API void saveDot(const std::vector< double > &weights, const std::vector< std::vector< double >> &positions, const std::vector< std::pair< int, int >> &graph, const std::string &file)
Saves the graph in .dot format (graphviz). The weight is saved as a label and the coordinates as a po...