Skip to content

SNUCSE-CTA/graph-transform-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graph-transform-tool

A graph transformation tool that converts edge list files to different formats.

Build

make

Usage

./graph_transform_tool [options] <input1> [input2 ...]

Options:

  • -f, --format <graph|igraph>: output format (default: graph)
  • -e, --out-ext <ext>: output extension (default: format name)
  • -g, --graph-id <id>: graph id for igraph header (default: 1)
  • -i, --input <path>: input file (can be repeated)

Examples

Convert SNAP to data.graph-style (header t <V> <E>, edges e u v):

./graph_transform_tool -f graph -e graph dataset/Ca-AstroPh.txt

Convert SNAP to yeast.igraph-style (header t # <id>, edges e u v 0):

./graph_transform_tool -f igraph -e igraph -g 1 dataset/Ca-AstroPh.txt

Outputs are written to transformed/ next to the binary, with the input basename and chosen extension.

Notes

  • Handles arbitrary whitespace, CRLF line endings, and comment headers (#, %, //).
  • Node ids are remapped to a compact 0..N-1 range.
  • Self-loops are removed, and multiple edges between the same two vertices are collapsed to one.
  • Vertex labels and edge labels are set to 0 by default.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published