feat: PageRank, betweenness centrality, entity resolution, weighted path, D3 viz, concurrency#1
Open
furkan-cyber wants to merge 2 commits into
Open
feat: PageRank, betweenness centrality, entity resolution, weighted path, D3 viz, concurrency#1furkan-cyber wants to merge 2 commits into
furkan-cyber wants to merge 2 commits into
Conversation
…on, weighted path, D3 viz, concurrency - analyze.ts: add computePageRank (30-iter damping 0.85), computeBetweenness (Brandes BFS, capped at 500 nodes), detectBridgeNodes (Tarjan articulation points); expose pageRank / betweenness / bridgeNodes on GraphBuilderAnalysis - build.ts: add resolveEntities() -- merges cross-document nodes of the same normalizedLabel+type (function/class/interface/enum/method) into a single node with mergedFrom[] metadata; activated via options.entityResolution - query.ts: replace BFS shortestPath with Dijkstra weighted by 1/confidenceScore; improve scoreNodes with prefix-match bonus (+50) and TYPE_PRIORITY weighting; GraphBuilderPathResult gains totalWeight field - artifacts.ts: replace vis-network HTML output with D3.js v7 force-directed interactive graph (zoom/pan, node colour by community, size by PageRank, edge style by confidence, hover tooltip, click-to-highlight, sidebar search with live node list and detail panel, label toggle, responsive resize) - graph-builder.ts: add concurrency-limited extraction via options.concurrency (worker-queue pattern); wire resolveEntities step after graph build - types.ts: add GraphBuilderNode.mergedFrom, GraphBuilderAnalysis.pageRank / betweenness / bridgeNodes, GraphBuilderPathResult.totalWeight, GraphBuilderOptions.concurrency / entityResolution - tests: 5 new tests covering all new features; total suite 18/18 passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 5 major capability improvements to graph-builder.
1. Graph Analytics (
analyze.ts)result.analysis.pageRankresult.analysis.betweennessresult.analysis.bridgeNodes2. Cross-Document Entity Resolution (
build.ts)resolveEntities(graph)function merges nodes with the samenormalizedLabel + type(function/class/interface/enum/method) that originate from different source items into a single canonical nodemergedFrom: string[]field listing the original IDsoptions.entityResolution: true3. Weighted Shortest Path + Improved Query Scoring (
query.ts)shortestPathupgraded from BFS to Dijkstra — edge weight =1 / confidenceScoreso high-confidence edges are preferredGraphBuilderPathResultgainstotalWeightfieldscoreNodesimproved: prefix-match bonus (+50),TYPE_PRIORITYmap that boosts document/class/function nodes and demotes resource/tag/package nodes4. D3.js Interactive HTML Visualization (
artifacts.ts)5. Concurrency-Limited Extraction (
graph-builder.ts)options.concurrencysetting limits parallel extraction workers (worker-queue pattern)Type Changes (
types.ts)GraphBuilderNode.mergedFrom?: string[]GraphBuilderAnalysis.pageRank / betweenness / bridgeNodesGraphBuilderPathResult.totalWeight?: numberGraphBuilderOptions.concurrency / entityResolutionTests
5 new tests added; full suite 18/18 passing.