Added a compress method to graphs and using a state pattern for allowing graph modification or not