Analysis of Greedy Local Search
Assume n vertices, m edges and D is the sum of the squares of the degrees in G. D < n2.
There are at most D iterations in the algorithm.
Each iteration consists of looking at each edge in the spanning tree and replacing it with some other edge, and checking for a cycle and computing costs. This is roughly O(n2m) time per iteration.
Total time is O(D n2m) = O(n4m) (worst case).