Add constructor to read graph from a file