graph write to file