update graph class for reading file constructor