Currently all nodes are stored in an array of size maxNodeId+1. This is wasteful in memory when the node ids are sparsely distributed. Make a sparse representation of the collection of nodes (e.g., using fastutils int2int map or a trie, or some other home grown version) that maps node id to a node efficiently and compactly.
Currently all nodes are stored in an array of size maxNodeId+1. This is wasteful in memory when the node ids are sparsely distributed. Make a sparse representation of the collection of nodes (e.g., using fastutils int2int map or a trie, or some other home grown version) that maps node id to a node efficiently and compactly.