More memory-efficient adjacency matrix