Next Previous Contents

4.5 Class BinaryGraphLoader

Defined in: argloader.h

Extends: ARGEdit

Overview: This class allows to read a graph without attributes from a binary file. The file format is the same used for the Graph Database, a large collection of graphs for benchmarking graph matching algorithms.

A static method is also provided in the class to write a graph in the same binary format.

File format

The file is composed by a sequence of 16-bit words; the words are encoded in little-endian format (e.g., LSB first). The first word represents the number of nodes in the graph. Then, for each node, there is a word encoding the number of edges coming out of that node, followed by a sequence of words encoding the endpoints of those edges.

An example, represented in hexadecimal, follows:


    03 00     Number of nodes (3)
    00 00     Number of edges out of node 0 (0)
    02 00     Number of edges out of node 1 (2)
    00 00     Target of the first edge of node 1 (edge 1 -> 0)
    02 00     Target of the second edge of node 1 (edge 1 -> 2)
    01 00     Number of edges out of node 2 (1)
    00 00     Target of the first (and only) edge of node 2 (edge 2 -> 0)


Next Previous Contents