Changed the graph to an immutable structure.