todo import { ITypedEdge } from "@/core/typed/TypedEdge" ; import { TypedGraph } from "@/core/typed/TypedGraph" ; import * as $I from "@/similarities/interfaces" ; import { knnNodeArray } from "@/similarities/SimilarityCommons" ; interface SubSetConfig extends $I . SortCutFuncs { rtype : string ; knn ? : number ; cutoff ? : number ; } /**
 *
 */ class TheAugments { constructor ( private _g ) { } todo addSubsetRelationship ( algo , sets , cfg ) { const edgeSet = new Set < ITypedEdge > ( ) ; let edge ; const g = this . _g ; const sims = knnNodeArray ( algo , sets , { knn : cfg . knn || 1 , cutoff : cfg . cutoff || 0 , } ) ; sims . forEach ( e => { if ( sets [ e . from ] . size <= sets [ e . to ] . size ) { edge = g . addEdgeByID ( "ontheedge" , g . n ( e . from ) , g . n ( e . to ) , { directed : true , type : cfg . rtype , } ) ; } else { edge = g . addEdgeByID ( "ontheedge" , g . n ( e . to ) , g . n ( e . from ) , { directed : true , type : cfg . rtype , } ) ; } edgeSet . add ( edge ) ; } ) ; return edgeSet ; } } export { TheAugments } ;