GitHunt
PE

peakcrosser7/GraphLoader

A header-only C++ library for graph data loading

GraphLoader

GraphLoader is a header-only C++ library tailored for graph data loading.
It supports formats like Matrix Market and SNAP, with flexible configurations for diverse graph processing scenarios.

How to use

Run the examples

The examples directory contains multiple sample codes to show how to use GraphLoader.
You can compile some of the example programs with the following commands.

mkdir build && cd build
cmake .. 
make

For detailed compilation and running instructions of each example, refer to the README.md in its corresponding directory.

Integrate into your graph framework

Core API:

template <typename vertex_t, typename edge_t, typename weight_t>
template <typename edge_load_func_t, 
          typename pre_load_func_t, 
          typename weight_parse_func_t>
static void GunrockLoader::Load(
    const std::string& filepath, 
    LoaderOpts& opts,
    const edge_load_func_t& edge_load_func, // bool FUNC(edge_t& eidx, vertex_t& src, vertex_t& dst, weight_t& val)
    const pre_load_func_t& pre_load_func,   // void FUNC() OR void FUNC(vertex_t num_v, edge_t num_e);
    const weight_parse_func_t& weight_parse_func    // weight_t FUNC(const char* str)
);

Implement the edge loading function edge_load_func() and the pre-loading function pre_load_func() (optional), and set the corresponding file configuration opts.

Languages

C++99.6%CMake0.4%

Contributors

Created November 2, 2024
Updated May 14, 2025