read topology from a file