Skip to content

Layout optimisation

When you generate a pipe layout using the MST (Minimum Spanning Tree) tool, TESSA connects all buildings with the shortest total pipe length. That is fast and always produces a connected tree, but it may not be the cheapest network to build or operate: a short detour through an existing road corridor can sometimes be worth the extra length, and a layout that minimises cost may differ from one that minimises heat loss.

The Optimise layout tool lets you re-run the layout with a cost-aware objective function.

How the default MST layout works

The default layout algorithm:

  1. Takes the candidate pipe routes (roads or straight-line connections, depending on your settings) and forms a distance matrix between all potential connection points.
  2. Computes the Minimum Spanning Tree — the connected sub-graph with the minimum total edge weight (distance).
  3. Routes pipes along those edges, attaching building substations as leaves.

The result is the shortest-length tree network. It is always connected, never contains loops, and is quick to compute.

The optimisation algorithm

The Optimise layout tool applies a heuristic refinement loop on top of the MST. It works by randomly perturbing the edge lengths in the distance matrix and re-computing the MST, checking at each iteration whether the new layout improves the chosen objective.

flowchart TD A["Start: initial MST layout"] --> B["Perturb edge lengths<br/>in distance matrix"] B --> C["Recompute MST"] C --> D["Evaluate cost function<br/>(cost / heat_total / heat_loss)"] D --> E{"Improved?"} E -->|"Yes"| F["Accept new layout<br/>as current best"] E -->|"No"| G["Discard perturbation"] F --> H{"Converged or<br/>max iterations?"} G --> H H -->|"No"| B H -->|"Yes"| I["Return best layout"] classDef step fill:#fff3e0,stroke:#ED6000,stroke-width:1.5px,color:#bf360c classDef decision fill:#bbdefb,stroke:#0d47a1,stroke-width:1.5px,color:#0d47a1 classDef terminal fill:#c8e6c9,stroke:#2e7d32,stroke-width:1.5px,color:#1b5e20 class A,B,C,D,F,G,I step class E,H decision

At each candidate layout, the tool runs the full pipe-sizing and simulation pipeline (including DNCosts) to compute the objective. This means each iteration is slower than a plain MST but the result is grounded in the actual cost model.

Optimisation objectives

Objective What it minimises When to use
cost Total pipe investment cost (installation + material, from the cost table) Most common; minimises CAPEX
heat_total Total heat transported through the network Minimises heat carried over long distances
heat_loss Total thermal losses along pipes Useful when loss reduction is the priority (e.g. high supply temperatures or long routes)

The cost objective is usually the right choice. heat_loss is worth trying when the supply temperature is high and the network spans a large area.

When to use optimisation

The optimisation tool runs significantly longer than the MST tool — each iteration re-sizes and re-simulates the network. For a district with hundreds of buildings it may take several minutes.

Use it when:

  • The initial MST layout looks like it takes unnecessarily long routes.
  • You have defined exclusion zones and want to find the lowest-cost routing around them.
  • You want to verify that the MST layout is close to optimal before finalising the design.

For a quick first-pass design the default MST layout is usually sufficient.

Exclusion zones

Like the MST tool, the optimiser respects exclusion zones — areas where pipes cannot be routed. Define exclusion zones in the study area layer editor before running either tool.

Where to go next