Activity Drivenยถ

Definition

Activity-driven temporal hypergraphs activate nodes with rates and create hyperedges at each time step.

You will learn

Generate temporal activity-driven hypergraphs and inspect their dynamics.

Overviewยถ

  • Generate a temporal activity-driven hypergraph from model parameters.

  • Inspect the resulting structure and basic statistics.

Setupยถ

[ ]:
import matplotlib as mpl

mpl.rcParams.update({
    "figure.figsize": (6, 4),
    "figure.dpi": 120,
    "savefig.dpi": 150,
})

[1]:
import sys
from collections import Counter

import numpy as np
import matplotlib.pyplot as plt

sys.path.append("..")
from hypergraphx.communities.hy_mmsbm.model import HyMMSBM
from hypergraphx.core.temporal_hypergraph import TemporalHypergraph
from hypergraphx.generation.hy_mmsbm_sampling import HyMMSBMSampler
from hypergraphx.linalg.linalg import *
from hypergraphx.dynamics.randwalk import *
from hypergraphx.generation.activity_driven import *
import random
[2]:
def rnd_pwl(xmin, xmax, g, size=1):
    r = np.random.random(size=size)
    return (r*( xmax**(1.-g) - xmin**(1.-g) ) + xmin**(1.-g) )**(1./(1.-g))

orders = [1,2,5]
beta_act = 2.25
eps = 0.001
N = 100
activities = rnd_pwl(eps, 1.0, beta_act, N)
activities_per_order = {order: activities for order in orders}
[3]:
HG = HOADmodel(N, activities_per_order, time=100)
[4]:
activities_per_order[1]
[4]:
array([0.00122684, 0.0030016 , 0.00115932, 0.00232638, 0.00123835,
       0.00146535, 0.01942779, 0.00155625, 0.00158992, 0.00117872,
       0.00175645, 0.00120718, 0.00166537, 0.0011417 , 0.00111237,
       0.00224994, 0.00124012, 0.00108481, 0.00169755, 0.00108913,
       0.00258711, 0.0018887 , 0.00139368, 0.00207586, 0.00112409,
       0.00202954, 0.00135815, 0.00280731, 0.00119374, 0.00239654,
       0.00145397, 0.00196627, 0.00517187, 0.0019846 , 0.00245724,
       0.00273485, 0.00279709, 0.00210364, 0.00404598, 0.00395033,
       0.00138353, 0.00288704, 0.0037446 , 0.0023175 , 0.00162702,
       0.00100739, 0.00183573, 0.00129032, 0.00234852, 0.00165624,
       0.00150109, 0.00169891, 0.00111026, 0.0017071 , 0.0079329 ,
       0.00201479, 0.00122535, 0.00246889, 0.00207982, 0.00255218,
       0.00500995, 0.00154157, 0.00337264, 0.00143736, 0.00138248,
       0.00147987, 0.00121604, 0.00161813, 0.00101783, 0.00245326,
       0.00224526, 0.0012563 , 0.00116481, 0.00209183, 0.00128031,
       0.00226608, 0.00180236, 0.00105422, 0.00232507, 0.00604522,
       0.00198912, 0.00190691, 0.0033083 , 0.00222755, 0.00118875,
       0.00102142, 0.00129231, 0.00102529, 0.01145748, 0.00485772,
       0.00252576, 0.00178571, 0.00263117, 0.00146426, 0.00157329,
       0.00484214, 0.00192983, 0.00132683, 0.0013145 , 0.00407684])