Modified Graph interface and Edge class.