Initialize graph from file