Given a graph its MSP (Minimum Spanning Tree, defined as ) is a connected sub-graph containing no cycles and spanning over all the nodes, also the MSP has the minimum possible total cost of the arcs (each arc has cost )
The arcs of that make the MSP are called or tree arcs, while the one that are excluded from the MSP are called non-tree arcs.
There are 2 equivalent condition for finding the MSP of a graph:
Cut Optimality
where: is the cut obtained by removing the arc from .
Path Optimality
where: is the path on from to .
Formulation of MSP Problem
- Variables:
: boolean, if belongs to , otherwise.
- Constants:
: cost of arc
: number of nodes
- Objective Functions:
(minimize the cost of the arcs in )
- Constraints:
span over all nodes → the number of arcs is fixed.
Where:
- is a set of arcs of the graph.
- S is a set containing all possible combination of arcs in the graph. no-cycles → Given all possible combination of arcs we have that each combination has to have a number of “active” arcs () less or equal than the number of nodes less present in the combination. (otherwise it would be a cycle)
Kruskal Algorithm:

Complexity: operations
Prim Algorithm
In practice the Prim Algorithm is the better one

Complexity: operations