Composite Edge Weighting for Leiden Community Detection in a GraphRAG-Style Knowledge Graph: Frequency, Relationship Strength and Semantic Similarity
Year: 2026
Type: preprint
Abstract: Graph-based Retrieval-Augmented Generation (GraphRAG) organizes a corpus as a knowledge graph of entities and relationships, partitions it into communities with the Leiden algorithm, and summarizes each community to answer corpus-level questions. The partition depends on the edge weights supplied to the clustering step, yet the weighting scheme is usually a single heuristic, namely the sum of LLM-assigned relationship strengths. This paper presents a reproducible experimental framework that compares edge-weighting signals for Leiden community detection. Three normalized features are derived for each edge: a log-normalized distinct-evidence frequency (F), a normalized mean LLM relationship strength (S), and an embedding-based similarity of the endpoint entity descriptions (C). Nine weighting variants are evaluated: a sum-of-strengths baseline, three single-feature weights, a frequency-plus-strength weight, the proposed composite W = 0.4F + 0.4S + 0.2C, and three leave-one-component-out ablations. The pipeline uses a locally hosted LLM (Qwen2.5-3B via Ollama) for evidence-grounded extraction, sentence-transformer embeddings (all- MiniLM-L6-v2), and weighted Leiden clustering with controlled seeds, and it reports NMI, ARI, seed stability, singleton share, connectivity and weighted modularity. A Streamlit dashboard exposes the same weighting logic for interactive, query-time exploration. On a small synthetic institutional-policy corpus (16 graph nodes, 14 undirected edges), all nine variants yielded the identical partition (3 communities, NMI = 0.901, ARI = 0.789, seed-stability ARI = 1.0); only the weighted modularity diagnostic differed, within a range of 0.0058. We trace this result to a lack of signal diversity in the graph: every edge had exactly one evidence instance, so F was constant, and S and C varied only narrowly. We therefore report no evidence that the composite weighting improves community quality at this scale, and we discuss the conditions under which the comparison becomes informative.
Source: Preprints.org
Authors: Akash Kumar A, Bhuvanesh D
Language: English
Topic: Topic Modeling
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7226029607
