DPGS
No description available
Install / Use
/learn @HQJo/DPGSREADME
DPGS
This repository implements a graph summarization algorithm. The source code is written in C++, and provide a simple wrapper for Python.
Run from C++
Input file format
You only need to provide a graph edgelist file in the following format. The first line contains the number of nodes, and each of the follwing line contains an edge given by two nodes. Node indices should be in the range of $[0, N-1]$.
Build & Run
To build the program, run make compile. You need to have a compiler with C++11 compatibility. You need to install boost_program_options library as well.
After building, you can execute ./main to run the program. Options include:
dataset: Dataset name. All the output files will be placed inoutput/{dataset}directory.input: Input edgelist file. The first line is the number of nodes $N$, and the rest of the file stores the edges (one edge each line). The node ids should in the range of $[0, N-1]$.--delimeter: Delimeter of edgelist file, default\t.--comment: Comment character of edgelist file, default#.--b: Maximum number of bands of LSH, default8.--seed: RNG seed, default42.--turn: Iteration turn of algorithm, default30.--debug: If specified, add debug information in log file.
You can also run run.sh {dataset} to run with default parameter. In this way, the graph edgelist should be placed in data/{dataset}.txt.
For more details about options, see the source code.
Output
The output contains three parts:
degrees.txt, which stores the degree of nodes.summary.edgelist, which stores the summary graph.supernodes.txt, which stores the supernode information.
To convert the result to python-friendly format, you can run python process_result.py {dataset}.
Run from Python (recommended)
We provide python binding for DPGS using pybind11. You are able to call the program from Python!
Input file format
In this case, you only need to provide a graph adjacency file, in scipy's .npz format. This is much faster than reading edgelist at C++ side.
Build & Run
To build the program, run make py. You need to have pybind11 installed (just run conda install pybind11), and have a compiler compatible to C++11 standard.
After building, you can execute python main.py to run the program. Options include:
dataset: Dataset name. All the output files will be placed inoutput/{dataset}directory.adj: Input adjacency matrix file, in scipy's.npzformat.--turn: Iteration turn of algorithm, default30.--b: Maximum number of bands of LSH, default8.--seed: RNG seed, default42.--debug: If specified, add debug information in log file.
Output
The only output file is nodes_dict.pkl, which contains supernodes information. Any other post-processing can be done based on it.
Related Skills
node-connect
335.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.7kCommit, push, and open a PR
