Text this: Minimization of Heat Losses in District Heating Networks by Optimizing their Configuration