As these are exponentially many, we add them via lazy constraints.
For this, we need to write a function that checks a solution if any of these constraints is violated.
We can do this efficiently by just looking at the connected components in the provided solution and add the constraint for every component (if there are more than one).
...
...
@@ -49,14 +45,10 @@ Note that while the set of constraints is exponential, we can derive the missing
For finding the minimum bottleneck, we introduce an additional variable $\ell \in \mathbb{R}^+_0$, that represent the length of the longest edge.
The objective function can be expressed easily as
```equation
\min \ell
```
$$\min \ell$$
To prohibit all edges larger than $\ell$, we add for every edge the constraint
```equation
\forall e\in E: \ell \leq c_e \cdot x_e
```
$$\forall e\in E: \ell \leq c_e \cdot x_e$$
where $c_e$ represents the length of the edge $e$.
## Finding the minimum weight spanning tree
...
...
@@ -65,8 +57,6 @@ After we have determined $\ell$, we look for the spanning tree with the lowest w
We can do so with nearly the same model, just delete $\ell$ and all $x_e$ with $c_e > \ell$.
Let $E'$ represent the remaining edges.
As objective function, we can use
```equation
\min \sum_{e\ in E'} c_e \cdot x_e
```
$$\min \sum_{e\ in E'} c_e \cdot x_e$$
which is simply the sum of the weight of the used edges.