read graph from file