// Diversity bonus = number of unique node types in the selected set x 0.5. // This breaks ties in favor of seeds that cover different parts of the graph. function selectDiverseSeeds(candidates: EntryNode[], k: number): EntryNode[] { const n = Math.min(candidates.length, 10) // cap to keep DP tractable const subset = candidates.slice(0, n) // ... // Count unique types covered const value = scoreSum + typeCount * 0.5 // <-- 0.5 dwarfs real score gaps (0.18-0.48) if (value > bestValue) { bestValue = value; bestMask = mask } // ... } // Gate: only runs when limit <= 5 (entryCount default 5) if (limit <= 5 && candidates.length > limit) { const diverse = selectDiverseSeeds(candidates, limit) if (diverse.length === limit) return diverse } return candidates.slice(0, limit)
3603bfa0-95ad-4715-a096-267a61b6f788
// Diversity bonus = number of unique node types in the selected set x 0.5. // This breaks ties in favor of seeds that cover different parts of the graph. function selectDiverseSeeds(candidates: EntryNode[], k: number): EntryNode[] { const n = Math.min(candidates.length, 10) // cap to keep DP tractable const subset = candidates.slice(0, n) // ... // Count unique types covered const value = scoreSum + typeCount * 0.5 // <-- 0.5 dwarfs real score gaps (0.18-0.48) if (value > bestValue) { bestValue = value; bestMask = mask } // ... }
// Gate: only runs when limit <= 5 (entryCount default 5) if (limit <= 5 && candidates.length > limit) { const diverse = selectDiverseSeeds(candidates, limit) if (diverse.length === limit) return diverse } return candidates.slice(0, limit)