read graph info from file