From 8f63cf9f41bbdb8d55cd4679872d2b4ae2129324 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Tue, 24 Feb 2026 08:40:49 +0000 Subject: EC-SBM community detection analysis: full pipeline and writeup Implement community detection on 3 EC-SBM networks (polblogs, topology, internet_as) using 5 methods (Leiden-Mod, Leiden-CPM at 0.1 and 0.01, Infomap, graph-tool SBM). Compute AMI/ARI/NMI accuracy, cluster statistics, and generate figures and LaTeX report. --- scripts/config.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/config.py (limited to 'scripts/config.py') diff --git a/scripts/config.py b/scripts/config.py new file mode 100644 index 0000000..b23b090 --- /dev/null +++ b/scripts/config.py @@ -0,0 +1,32 @@ +"""Central configuration for EC-SBM community detection analysis.""" + +import os + +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +DATA_DIR = os.path.join(BASE_DIR, "data") +RESULTS_DIR = os.path.join(BASE_DIR, "results") + +NETWORKS = { + "polblogs": { + "edge_tsv": os.path.join(DATA_DIR, "polblogs", "edge.tsv"), + "com_gt_tsv": os.path.join(DATA_DIR, "polblogs", "com_gt.tsv"), + }, + "topology": { + "edge_tsv": os.path.join(DATA_DIR, "topology", "edge.tsv"), + "com_gt_tsv": os.path.join(DATA_DIR, "topology", "com_gt.tsv"), + }, + "internet_as": { + "edge_tsv": os.path.join(DATA_DIR, "internet_as", "edge.tsv"), + "com_gt_tsv": os.path.join(DATA_DIR, "internet_as", "com_gt.tsv"), + }, +} + +METHODS = [ + {"name": "leiden_mod", "type": "leiden", "quality": "modularity"}, + {"name": "leiden_cpm_01", "type": "leiden", "quality": "cpm", "resolution": 0.1}, + {"name": "leiden_cpm_001", "type": "leiden", "quality": "cpm", "resolution": 0.01}, + {"name": "infomap", "type": "infomap"}, + {"name": "graphtool_sbm", "type": "graphtool_sbm"}, +] + +SEED = 42 -- cgit v1.2.3