Constructs the NIM Graph