Added the possibility of memory optimization in the graph structure