Skip to content

XGraph-Team/XFlow

Repository files navigation

PyPI Testing Status Docs Status Contributing

XFlow Homepage | XFlow Paper | Documentation | Paper Collection

XFlow is a library built upon Python to easily write and train method for a wide range of applications related to graph flow problems. XFlow is organized task-wise, which provide datasets benchmarks, baselines and auxiliary implementation.

Update: FlowGPT: a custom GPT for graph dynamics analysis.

Installation

pip install xflow-net

Example

Open In Colab

Import XFlow

import xflow.dataset.nx as nx_datasets
import xflow.dataset.pyg as pyg_datasets
import xflow.diffusion as diffusion_models
import xflow.seed as seeds
import xflow.util as util
import xflow.method.im as im_methods
import xflow.method.ibm as ibm_methods
import xflow.method.cosasi.source_inference.multiple_source as source_inference

Influence Maximization

# Graphs to test
fn = lambda: nx_datasets.connSW(n=1000, beta=0.1)
fn.__name__ = 'connSW'
gs = [fn, pyg_datasets.Cora]

# Diffusion models to test
df = [diffusion_models.SI, diffusion_models.IC, diffusion_models.LT]

# Seed configurations to test
se = [seeds.random, seeds.degree, seeds.eigen]

# Configurations of IM experiments
im_experiments = [im_methods.pi, im_methods.eigen]
rt = util.run(
    graph=gs, diffusion=df, seeds=se,
    method=im_experiments, eval='im', epoch=10,
    budget=10,
    output=['animation', 'csv', 'fig']
)

Maximizing Blocking

ibm_experiments = [ibm_methods.sigma, ibm_methods.degree]
rt = util.run(
    graph=gs, diffusion=df, seeds=se,
    method=ibm_experiments, eval='ibm', epoch=10,
    budget=10,
    output=['animation', 'csv', 'fig']
)

See more examples in folder examples

Benchmark Task

Influence Maximization

Blocking Maximization

Source Localization

Experimental Configurations

How to Cite

We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To To demonstrate the value of XFlow, we ask that you cite XFlow in your work.

@article{zhang2023xflow,
  title={XFlow: Benchmarking Flow Behaviors over Graphs},
  author={Zhang, Zijian and Zhang, Zonghan and Chen, Zhiqian},
  journal={arXiv preprint arXiv:2308.03819},
  year={2023}
}

Contact

Feel free to email us if you wish your work to be listed in this repo. If you notice anything unexpected, please open an issue and let us know. If you have any questions or are missing a specific feature, feel free to discuss them with us. We are motivated to constantly make XFlow even better.