Minimal distance between two clusters in (ℝ^3)

Input: skup točaka klastera πj koje ripadaju   ellipsoidu E p (c?j);
Output: Minimal distance between two clusters of the partition Π;
Submodules: MinEl[]

Clear[MDInd3]
MDInd3[Mdisk_]:=Module[{k=Length[Mdisk],DDD,konv}, 
DDD=Table[0,{r,Length[Mdisk]},{s,Length[Mdisk]}];
						(* Convex Hull *)			 
konv=Table[ConvexHullMesh[Mdisk[[j]]],{j,Length[Mdisk]}];
Do[
Do[
If[RegionDimension[RegionIntersection[konv[[r]],konv[[s]]]]==3,DDD[[r,s]]=0,DDD[[r,s]]=Min[Table[RegionDistance[konv[[r]],Mdisk[[s,j]]],{j,Length[Mdisk[[s]]]}]]];
,{s,r+1,Length[Mdisk]}];
,{r,Length[Mdisk]}];
Print["DDD=",MatrixForm[DDD]," - distance matrix D between clusters"];
MinEl[DDD]
]