8 Nov
2013
8 Nov
'13
12:01 p.m.
Dear all, I need to optimize my code with regards to both memory and time. The problem is simple: pre-allocating the adjacency matrix. The graph may have a huge number of nodes N, but the number of edges K per node is limited. While N can be in the order of one hundred million, K is at most 10. The graph will be directed, so no symmetry is needed. Do you know if I can pre-allocate such an adjacency matrix? If not, I suppose I must use an adjacency list in order to minimize memory consumption, am I right? Thanks!