Krushkal implementation