is it possible to create a bit adjacency array for a graph with c++11 in 64 bit system
I need to deploy a graph with large size, say N=10000000. But the compiler do not allowed me to define a two dimension, large size array, like Adj[N][N]. I just deploy graph with which weight is 0. If two nodes have a link, the correspondent element of Adj[N][N] is 1, otherwise 0. So I just need one bit to do this. I was wondering whether I can use a long bit memory to store a bit array to describe a two dimension array.
For example:
4X4 adjacency matrix with 16 bit array: 1010010100110110
So that element 1,1 is 1, element 1,2 is 0, ......, element 4,4 is 0
I need bit operation to find the element that I need to deploying.
The problem is how to do this? How to allocate a long continuous bit storage in memory? malloc
? how to define the pointer? void type?
EDIT
Let's say 10000000. Maybe 90T memory for unsigned char. I knew that there is someone deploying 10^7 nodes. Maybe they are using vector or list which is dynamic allocation memory.