الشبكة الاجتماعية تشبه المدينة: فيها أحياء عملاقة وأزقة صغيرة. عندما يبحث خوارزمي عن مجموعات متماسكة فيها، غالبًا ما يميز زوجًا من المجموعات الضخمة والكثير من الشظايا الصغيرة. لكن العميل — مثل البلدية — يحتاج إلى أحياء متقاربة الحجم لتوزيع العيادات أو المدارس بالتساوي.
الحيلة المعتادة هي تدوير مقبض "السماح" الذي يجعل جميع المجتمعات في المتوسط أكبر أو أصغر. هذا مثل تغيير البؤرة في المنظار: الصورة العامة تهتز، لكن المجموعات الفردية تظل بعضها كبيرًا جدًا وبعضها صغيرًا جدًا. سلك مؤلفو العمل طريقًا مختلفًا: أضافوا إلى خوارزمية تجميع الشبكة نفسها إطارًا صارمًا — الحد الأدنى والحد الأقصى المسموح به لحجم كل مجتمع. الآن لا يبحث البرنامج فقط عن الروابط الوثيقة، بل يراقب أيضًا ألا تتجاوز أي مجموعة الحدود المحددة، مثل خباز يشكل الكعكات وفق قالب واحد.
الخلاصة بسيطة: إذا كان من المهم بالنسبة لك أن تكون المجموعات في الشبكة ليست فقط مترابطة ولكن أيضًا متناسبة، فهناك الآن أداة تستطيع فعل ذلك مباشرة دون ضبط يدوي. الكود مدمج بالفعل في حزمة Leiden — واحدة من أكثر الأدوات استخدامًا لتحليل الرسوم البيانية.
كما كتبه المؤلفون، بالإنجليزية arXiv:2605.25248
When searching for communities in networks, domain experts may have some prior expectations about the size of communities. Yet, community detection methods normally do not optimize communities under cluster size constraints. Multi-resolution techniques allow users to indirectly control the average community size through changing a resolution parameter, but this practice does not control the size of individual communities. We here study the problem of size-constrained community detection, where the size of all communities is limited to a user-specified range of values, in the context of modularity optimization. We propose a heuristic for modularity optimization under community size constraints. To demonstrate the reliability of our proposed heuristic, we also formulate an exact integer optimization model and use its results as a baseline. Our analysis based on synthetic benchmarks and real networks demonstrate the issues with the currently common practice of changing resolution parameters and reveal the advantages of the proposed methods as a principled way of obtaining size-constrained communities. The proposed method is publicly available in the Python Leiden algorithm package.
كلمة "مجتمع" في تحليل الشبكات لا تعني مجموعة اهتمامات مشتركة — إنها مجرد مجموعة من العقد التي تكون الروابط داخلها أكثر من الروابط إلى الخارج، مثل كتلة من النمل على قطعة سكر واحدة.