Minimal distance between two clusters in (ℝ^2)

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[MDInd2]
MDInd2[Mdisk_]:=Module[{k=Length[Mdisk],DDD,konv,poly,dist,minPts}, 
						(* Convex Hull *)			 
konv=Table[ConvexHull[Mdisk[[j]]],{j,Length[Mdisk]}];
Do[
poly[j]=Polygon[Mdisk[[j,konv[[j]]]]]
,{j,Length[Mdisk]}];
pol=Table[poly[j][[1]],{j,k}];
DDD=Table[0,{r,Length[Mdisk]},{s,Length[Mdisk]}];
Do[
Do[
(* 
If[RegionDimension[RegionIntersection[poly[r],poly[s]]]==2,DDD[[r,s]]=0,DDD[[r,s]]=Dmin[Mdisk[[r,konv[[r]]]],Mdisk[[s,konv[[s]]]]]];
*)
ℛ=RegionIntersection[poly[r],poly[s]];
If[ℛ==EmptyRegion[2],DDD[[r,s]]=Dmin[Mdisk[[r,konv[[r]]]],Mdisk[[s,konv[[s]]]]],
DDD[[r,s]]=0]
,{s,r+1,Length[Mdisk]}];
,{r,Length[Mdisk]}];
Print["DDD=",MatrixForm[DDD]," - distance matrix between clusters"];
{MinEl[DDD],pol}
]