Community search aims to identify a refined set of nodes that are most relevant to a given query, supporting tasks ranging from fraud detection to recommendation. Unlike homophilic graphs, many real-world networks are heterophilic, where edges predominantly connect dissimilar nodes. Therefore, structural signals that once reflected smooth, low-frequency similarity now appear as sharp, high-frequency contrasts. However, both classical algorithms (e.g., k-core, k-truss) and recent ML-based models struggle to achieve effective community search on heterophilic graphs, where edge signs or semantics are generally unknown. Algorithm-based methods often return communities with mixed class labels, while GNNs, built on homophily, smooth away meaningful signals and blur community boundaries. Therefore, we propose Adaptive Community Search (AdaptCS), a unified framework featuring three key designs: (i) an AdaptCS Encoder that disentangles multi-hop and multi-frequency signals, enabling the model to capture both smooth (homophilic) and contrastive (heterophilic) relations; (ii) a memory-efficient low-rank optimization that removes the main computational bottleneck and ensures model scalability; and (iii) an Adaptive Community Score (ACS) that guides online search by balancing embedding similarity and topological relations. Extensive experiments on both heterophilic and homophilic benchmarks demonstrate that AdaptCS outperforms the best-performing baseline by an average of 11% in F1-score, retains robustness across heterophily levels, and achieves up to 2 orders of magnitude speedup.
翻译:社区搜索旨在识别与给定查询最相关的精炼节点集合,支持从欺诈检测到推荐等多种任务。与同质图不同,许多现实世界网络是异质的,其中边主要连接相异节点。因此,曾经反映平滑、低频相似性的结构信号现在表现为尖锐、高频的对比。然而,无论是经典算法(如k核、k桁架)还是近期基于机器学习的方法,在边符号或语义通常未知的异质图上都难以实现有效的社区搜索。基于算法的方法常返回具有混合类别标签的社区,而基于同质性假设的图神经网络则会平滑掉有意义的信号并模糊社区边界。为此,我们提出自适应社区搜索(AdaptCS),这是一个统一框架,具有三个关键设计:(i)一个AdaptCS编码器,能够解耦多跳与多频信号,使模型既能捕捉平滑(同质)关系也能捕捉对比(异质)关系;(ii)一种内存高效的低秩优化方法,消除了主要计算瓶颈并确保模型的可扩展性;以及(iii)一种自适应社区评分(ACS),通过平衡嵌入相似性与拓扑关系来指导在线搜索。在异质与同质基准上的大量实验表明,AdaptCS在F1分数上平均优于最佳基线11%,在不同异质水平下保持鲁棒性,并实现了高达两个数量级的加速。