Density Based Clustering index for optimal partition with geometrical objects

(* DBC-modul gives QD value for Oval. Ako se želi koristiti za druge krivulje, umjesto  DGcir[]treba pozvati modul za udaljenost točke do te krivulje. *)

Input: partition Π of the set 𝒜 ⊂ (ℝ^n), geometrical objects;
Output: QD index of the partition Π;
Submodules: DGcir[]

DBC[PI_,Circles_]:=Module[{k1,h,rho={},mad={},QAD={},rj},
k1=Length[Circles]; 
Do[
mj=Length[PI[[j]]];
dC=2Pi Circles[[j,2]]+2Norm[Circles[[j,1,1]]-Circles[[j,1,2]]];
ud1=Table[DGcir1[PI[[j,s,2]],Circles[[j,1]],Circles[[j,2]]],{s,mj}];
QAD=Append[QAD,Mean[ud1]+2Sqrt[Variance[ud1]]];
,{j,Length[Circles]}]; 
Print["Veličine ",k1," klastera: ",LPI=Table[Length[PI[[j]]],{j,k1}]];
(*Print["QAD: ",QAD, "; Max[QAD] = ",Max[QAD]]; *)
{Max[QAD],QAD}
];