This paper is published at VLDB 2025. This repository contains the code for the manuscript:
Continuous Publication of Weighted Graphs with Local Differential Privacy
To run the experiments in this repository, you need numpy, networkx, scikit-learn. You can install all the packages is through conda and pip:
pip install numpy
pip install networkx
pip install scikit-learndatais the folder with all datasets.EmailDept1_LDPis the Email-Eu dataset in our paper, which contains dynamic communications between 319 nodes over 173 time steps.Forum_LDPis the Forum dataset in our paper, which contains dynamic interaction records between 899 students over 24 time steps.Tech_LDPis the Tech-AS dataset in our paper, which contains dynamic connections between 5000 autonomous systems over 24 time steps.
resultis the folder for storing synthetic weighted graph (.txt format), including two examples.SynGraph_Savestores the average results of ten runs on the Forum dataset when the privacy budget is 1.SynGraph_Save_vary_wstores the average results of ten runs on the Forum dataset when the sliding window size is 6.
main.pyis the file used to run the WGT-LDP framework with different privacy budgets.main_vary_w.pyis the file used to run the WGT-LDP framework with different sliding windows.main_event.pyis the file used to run the WGT-LDP framework with event-level privacy.utils.pyincludes some functions that are needed for other files.IM_spread_LDP_eps.pyis used to obtain the results of influence maximization under different privacy budgets.IM_spread_LDP_win.pyis used to obtain the results of influence maximization under different sliding windows.
you can run main experiments with python {file name}.py.
###### Example 1 ######
python main.py
###### Example 2 ######
python main_vary_w.py
###### Example 3 ######
python main_event.pyDefault dataset: Forum (pre-configured).
To switch datasets (e.g. to Tech-AS):
- Comment out Forum block in your target main_*.py file:
# dataset: Forum
# data_path = "./data/Forum_LDP/FbForum"
# node_num = 899
# snapshot_num = 24
# max_h = 168- Uncomment target dataset block:
# dataset: Tech-AS
data_path = "./data/Tech_LDP/tech"
node_num = 5000
snapshot_num = 24
max_h = 24you can run influence maximization experiments with python {file name}.py.
###### Example 1 ######
python IM_spread_LDP_eps.py
###### Example 2 ######
python IM_spread_LDP_win.pyPreparation (required before running IM experiments):
- Run a main experiment with graph saving enabled:
- In the main experiment file (e.g.,
main.py), uncomment:- Target
dataset_nameassignment. utils.save_graph_with_params(...)call.
- Target
###### Example ######
# Before:
# dataset_name = "tech"
# utils.save_graph_with_params(dataset_name, epsilon, ...)
# After:
dataset_name = "tech"
utils.save_graph_with_params(dataset_name, epsilon, ...)Note: Run main experiment after this change to generate synthetic graph data (.txt format).
- Configure the IM experiment file:
- In
IM_spread_LDP_eps.pyorIM_spread_LDP_win.py, setdataset_nameto match:
# For Tech-AS:
dataset_name = 'tech'- Dataset Consistency: The dataset name must be identical in the main experiment (when saving) and the IM experiment.
- File-Specific Configuration: Each main experiment file (main.py, main_vary_w.py, main_event.py) has its own configuration block. If you switch datasets, you must update the configuration in the specific main file you are running.
- Graph Saving: Only uncomment the saving code when you intend to generate data for IM experiments (it may slow down the main experiment).