Motivation
NetworKit, in Globals.hpp, defines all nodes as uint64_t, and so all graphs and algorithms are forced to use this data type. It would be nice to provide a knob so that they can instead of uint32_t, which would cut in half the memory usage the graph, and any node-sized memory allocations, on graphs of <2^32 ~ 4 billion nodes.
Proposed API
This can be a build option, e.g. cmake .. -DNETWORKIT_32_BIT_NODES. From the python side, pip install icebug[rt32], which would configure the 32-bit node build. Keeping the default as 64-bit would not break backwards compatibility.
Potential Challenges
There are a lot of implicit type conversions between, say, node and count and index and omp_index.
The CSR indices and indptr are also both hard-coded as Arrow::UInt64Array, where the indices would have to be changed to also allow Arrow::UInt32Array.
Motivation
NetworKit, in
Globals.hpp, defines all nodes asuint64_t, and so all graphs and algorithms are forced to use this data type. It would be nice to provide a knob so that they can instead ofuint32_t, which would cut in half the memory usage the graph, and any node-sized memory allocations, on graphs of <2^32 ~ 4 billion nodes.Proposed API
This can be a build option, e.g.
cmake .. -DNETWORKIT_32_BIT_NODES. From the python side,pip install icebug[rt32], which would configure the 32-bit node build. Keeping the default as 64-bit would not break backwards compatibility.Potential Challenges
There are a lot of implicit type conversions between, say,
nodeandcountandindexandomp_index.The CSR indices and indptr are also both hard-coded as
Arrow::UInt64Array, where theindiceswould have to be changed to also allowArrow::UInt32Array.