Add constructor for the Graph class.