Ground truth Generation Parameters
This reference page provides a comprehensive overview of parameters used in generating evolving communities with the dyn-benchmark package.
As describe in our paper, the benchmark generation process consists of three main components:
Evolving Communities Generation: Creates evolving communities and their interactions
Node Generation: Assigns members to communities at each snapshot
Graph Generation: Creates the underlying network structure
Each component is configurable through various parameters that control the properties of the generated benchmark.
1. Evolving Communities Generator Parameters
Community Generator
The CommunitiesGenerator class creates the structure of evolving communities:
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Number of evolving communities to generate |
|
|
Number of time snapshots in the temporal network |
|
|
Minimum size of any static community |
|
|
Fraction of members that stay in the same community between snapshots |
|
|
Algorithm for matching communities across snapshots |
|
|
Random seed for reproducibility |
Example of creating a custom community generator:
generator = CommunitiesGenerator(
community_count=15,
snapshot_count=10,
community_size_min=5,
core_nodes_ratio=0.7
)
Probability Distribution Methods
Community evolution is controlled by probability distributions via these methods that can be overridden in custom subclasses:
Method |
Default Distribution |
Description |
|---|---|---|
|
Normal(μ=10, σ=3) |
Initial size of communities |
|
TruncNormal(μ=3, σ=2, min=1, max=5) |
How long communities exist |
|
Uniform(0, 1) |
When communities appear (scaled to valid snapshot range) |
|
Normal(μ=0, σ=0.2) |
How communities change in size over time |
Example of custom probability distributions:
class CustomGenerator(CommunitiesGenerator):
def draw_community_size(self, *args, **kwargs):
return self.rng.normal(loc=50, scale=10)
def draw_community_lifetime(self, *args, **kwargs):
return max(2, min(self.snapshot_count, self.rng.normal(loc=6, scale=2)))
Matching Metrics
Three metrics are available for determining how communities are linked across snapshots:
Metric |
Formula |
Use Case |
|---|---|---|
|
When community sizes vary significantly |
|
|
Default, balanced approach |
|
|
When community sizes are stable |
2. Node Generator Parameters
The RandomMemberGenerator class assigns members to communities:
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Random seed for reproducibility |
Member attributes (generated internally):
Attribute |
Description |
|---|---|
|
Tendency to join previously visited communities |
|
Tendency to stay out of the network temporarily |
3. Graph Generator Parameters
Multiple graph generation models are available:
Stochastic Block Model (SBM)
The Stochastic Block Model (SBM) implements a classic community-based random graph model where edge probabilities depend on community membership, available through the SBM class.
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Probability of edge between nodes in same community |
|
|
Probability of edge between nodes in different communities |
|
|
Maximum attempts to generate a connected graph |
|
|
Random seed for reproducibility |
Preferential Attachment Model (PAM)
The Preferential Attachment Model (PAM) creates scale-free networks where new nodes preferentially connect to existing high-degree nodes, implemented in the PAM class.
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Number of edges to add for each new node |
|
|
Whether self-loops are allowed |
|
|
Random seed for reproducibility |
Block Preferential Attachment Model (BPAM) and FastBPAM
The Block Preferential Attachment Model (BPAM) and its optimized variant FastBPAM combine community structure with preferential attachment, creating realistic networks with both community organization and scale-free properties, available through the BPAM and FastBPAM classes.
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Intra-community interaction strength |
|
|
Inter-community interaction strength |
|
|
Number of edges to add for each new node |
|
|
Whether self-loops are allowed |
|
|
Random seed for reproducibility |
Main Generator Parameters
The GroundtruthGenerator combines all components:
Parameter |
Default Value |
Description |
|---|---|---|
|
|
Generator for evolving communities |
|
|
Generator for members |
|
|
Generator for network structure |
|
|
Master seed for reproducibility |
For monitoring progress during generation:
# Use ProgressiveGroundtruthGenerator instead of GroundtruthGenerator
# for visual feedback during generation
generator = ProgressiveGroundtruthGenerator(
community_generator=CommunitiesGenerator(),
seed=42
)
4. Some examples
For realistic social network-like benchmarks:
# Social network-like settings
generator = GroundtruthGenerator(
community_generator=CommunitiesGenerator(
community_count=20,
snapshot_count=10,
community_size_min=5,
core_nodes_ratio=0.7
),
edge_generator=FastBPAM(
gamma_in=0.7,
gamma_out=0.05,
m=5
),
seed=42
)
For stable communities with clear boundaries:
# Stable, clearly defined communities
generator = GroundtruthGenerator(
community_generator=CommunitiesGenerator(
core_nodes_ratio=0.9
),
edge_generator=SBM(
p_in=0.8,
p_out=0.01
),
seed=42
)
For highly dynamic communities:
# Highly dynamic communities
generator = GroundtruthGenerator(
community_generator=CommunitiesGenerator(
core_nodes_ratio=0.3
),
edge_generator=SBM(
p_in=0.6,
p_out=0.1
),
seed=42
)