This is the implementation of our paper "Virtual Nodes go Temporal". We propose to add Virtual Nodes to a TGN to enhance its capacity to propagate information within the graph after an event occurence. The VNs are related to communities within the graph, where we consider using an adaptation of K-Means to create these communities.
The code is based on the original TGB Implementation. We adapted the implementation to take into account the addition of virtual nodes. Therefore the requirements for to run the code: 1. Having the TGB implementation. 2. PyTorch Geometric 3. NetworkX
The user should start by downloading TGB and the required requirements. We refer the users to the installation guidelines on https://tgb.complexdatalab.com/.
We note that since we also add some requirements and args (related to the VNs like number of communities), "utils.py" file should be changed. The adapted script is provided in the "./TGB" folder, and the user should also substitute the "utils.py" in TGB/tgb/utils folder. Otherwise, you can choose to enter the values manually (directly in the script).
To run our k-TVNs for the TGBL-Wiki with the default parameters (also used in the main paper):
python main.pyYou can additionally specify the number of communities as:
python main.py --n_communities 2For any additional information, please refer to our paper.
Upon using this repository for your work, or finding our proposed analysis useful for your research, please consider citing our paper this paper:
@inproceedings{
ennadir2025virtual,
title={Virtual Nodes Go Temporal},
author={Sofiane ENNADIR and Yassir Jedra and Oleg Smirnov and Lele Cao},
booktitle={The Fourth Learning on Graphs Conference},
year={2025},
url={https://openreview.net/forum?id=jdKtkiH9ze}
}
For any additional questions/suggestions you might have about the code and/or the proposed analysis, please contact: sofiane.ennadir@king.com