Skip to content

Commit bf1c4b4

Browse files
committed
v4.23.0b14
1 parent 3ae9edc commit bf1c4b4

File tree

9 files changed

+228
-166
lines changed

9 files changed

+228
-166
lines changed

analysis/sampling/paper/main.tex

Lines changed: 211 additions & 150 deletions
Large diffs are not rendered by default.

analysis/sampling/paper/tables/tab1_ew_comparison.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1\,km & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} \\
1515
2\,km & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} \\
1616
5\,km & \multicolumn{2}{c}{exact} & \multicolumn{2}{c}{exact} & 1{,}506 & 58.7\% & 847 & 33.0\% & 542 & 21.1\% \\
17-
10\,km & \multicolumn{2}{c}{exact} & 3{,}822 & 37.3\% & 1{,}698 & 16.6\% & 955 & 9.3\% & 611 & 6.0\% \\
17+
10\,km & \multicolumn{2}{c}{exact} & 3{,}822 & 37.3\% & 1{,}699 & 16.6\% & 955 & 9.3\% & 611 & 6.0\% \\
1818
20\,km & 17{,}022 & 41.5\% & 4{,}255 & 10.4\% & 1{,}891 & 4.6\% & 1{,}063 & 2.6\% & 680 & 1.7\% \\
1919
\bottomrule
2020
\end{tabular}

analysis/sampling/paper/tables/tab2_validation.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
\vspace{0.5em}
2121
\footnotesize
22-
Network: Greater London Area. Deterministic distance-based schedule:
22+
Network: Greater London Authority, \glaNnodes{} nodes. Deterministic distance-based schedule:
2323
same $p$ for both metrics at each distance.
2424
Subscripts: $c$ = closeness, $b$ = betweenness.
2525
\end{table}

analysis/sampling/paper/tables/tab4_madrid_validation.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
\vspace{0.5em}
2121
\footnotesize
22-
Network: Greater Madrid, 64,609 nodes. Deterministic distance-based schedule:
22+
Network: Greater Madrid, \madridNnodes{} nodes. Deterministic distance-based schedule:
2323
same $p$ for both metrics at each distance.
24+
Subscripts: $c$ = closeness, $b$ = betweenness.
2425
\end{table}

analysis/sampling/paper/tables/tab_distance_lookup.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
\begin{table}[htbp]
22
\centering
3-
\caption{Deterministic sampling schedule by analysis distance ($\varepsilon = 0.06$, $\delta = 0.1$, canonical grid spacing $s = 175\,\text{m}$). Both closeness and betweenness use the same schedule. Sampling is exact ($p = 100\%$) for distances up to 4\,km. Speedup shown is theoretical ($1/p$); measured wall-clock speedup is lower at near-unity $p$ due to sampling overhead and emerges at 10\,km and beyond.}
3+
\caption{Deterministic sampling schedule by analysis distance ($\varepsilon = 0.06$, $\delta = 0.1$, canonical grid spacing $s = 175\,\text{m}$). Both closeness and betweenness use the same schedule. Sampling is exact ($p = 100\%$) for distances up to 2\,km. Speedup shown is theoretical ($1/p$); measured wall-clock speedup is lower at near-unity $p$ due to sampling overhead and emerges at 10\,km and beyond.}
44
\label{tab:distance_lookup}
55
\begin{tabular}{rrrrr}
66
\toprule

analysis/sampling/scripts/01_analyse_synthetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def fmt_pct(p):
305305
d_str = f"{int(row['distance'] // 1000)}\\,km" if row['distance'] >= 1000 else f"{row['distance']}\\,m"
306306
latex += d_str
307307
for eps in EPSILON_TARGETS:
308-
k = int(row[f"k_{eps}"])
308+
k = math.ceil(row[f"k_{eps}"])
309309
p = row[f"p_{eps}"]
310310
if p >= 1.0:
311311
latex += " & \\multicolumn{2}{c}{exact}"

analysis/sampling/scripts/02_validate_gla.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def generate_validation_table(summary_df: pd.DataFrame):
562562
563563
\vspace{0.5em}
564564
\footnotesize
565-
Network: Greater London Area. Deterministic distance-based schedule:
565+
Network: Greater London Authority, \glaNnodes{} nodes. Deterministic distance-based schedule:
566566
same $p$ for both metrics at each distance.
567567
Subscripts: $c$ = closeness, $b$ = betweenness.
568568
\end{table}

analysis/sampling/scripts/03_validate_madrid.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,15 @@ def generate_validation_table(df: pd.DataFrame, n_nodes: int | None):
559559
latex += f"{p_pct} & {rho_c} & {spd_c} & "
560560
latex += f"& {rho_b} & {spd_b} \\\\\n"
561561

562-
n_nodes_str = f"{n_nodes:,}" if n_nodes else r"\texttildelow 99,000"
563-
latex += rf"""\bottomrule
564-
\end{{tabular}}
562+
latex += r"""\bottomrule
563+
\end{tabular}
565564
566-
\vspace{{0.5em}}
565+
\vspace{0.5em}
567566
\footnotesize
568-
Network: Greater Madrid, {n_nodes_str} nodes. Deterministic distance-based schedule:
567+
Network: Greater Madrid, \madridNnodes{} nodes. Deterministic distance-based schedule:
569568
same $p$ for both metrics at each distance.
570-
\end{{table}}
569+
Subscripts: $c$ = closeness, $b$ = betweenness.
570+
\end{table}
571571
"""
572572

573573
output_path = TABLES_DIR / "tab4_madrid_validation.tex"

analysis/sampling/scripts/05_generate_macros.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def generate_macros() -> str:
102102
for dist in [1000, 2000, 5000, 10000, 20000]:
103103
p = compute_distance_p(dist, epsilon=PAPER_EPSILON_CLOSENESS, delta=HOEFFDING_DELTA)
104104
r = math.pi * dist**2 / GRID_SPACING**2
105-
k = math.log(2 * r / HOEFFDING_DELTA) / (2 * PAPER_EPSILON_CLOSENESS**2)
105+
k = math.ceil(math.log(2 * r / HOEFFDING_DELTA) / (2 * PAPER_EPSILON_CLOSENESS**2))
106106
speedup = 1.0 / p if p < 1.0 else 1.0
107107
distance_scenarios[dist] = {"p": p, "k": k, "canonical_reach": r, "speedup": speedup}
108108

@@ -349,7 +349,7 @@ def generate_tab_distance_lookup() -> str:
349349
+ f"{GRID_SPACING:.0f}"
350350
+ r"\,\text{m}$). "
351351
r"Both closeness and betweenness use the same schedule. "
352-
r"Sampling is exact ($p = 100\%$) for distances up to 4\,km. "
352+
r"Sampling is exact ($p = 100\%$) for distances up to 2\,km. "
353353
r"Speedup shown is theoretical ($1/p$); measured wall-clock speedup is lower "
354354
r"at near-unity $p$ due to sampling overhead and emerges at 10\,km and beyond.}"
355355
)
@@ -359,10 +359,10 @@ def generate_tab_distance_lookup() -> str:
359359
lines.append(r"\textbf{Distance} & \textbf{Canonical reach} & \textbf{$k$} & \textbf{$p$ (\%)} & \textbf{Speedup ($1/p$)} \\")
360360
lines.append(r"\midrule")
361361
for d, r, p, speedup in rows:
362-
k = math.log(2 * r / delta) / (2 * eps**2) if r > 0 else 0
362+
k = math.ceil(math.log(2 * r / delta) / (2 * eps**2)) if r > 0 else 0
363363
d_str = f"{d // 1000}\\,km"
364364
r_str = f"{r:,.0f}".replace(",", "{,}")
365-
k_str = f"{k:,.0f}".replace(",", "{,}")
365+
k_str = f"{k:,}".replace(",", "{,}")
366366
p_str = f"{p * 100:.0f}" if p >= 1.0 else f"{p * 100:.1f}"
367367
spd_str = "1$\\times$" if p >= 1.0 else f"{speedup:.1f}$\\times$"
368368
lines.append(f"{d_str} & {r_str} & {k_str} & {p_str} & {spd_str} \\\\")

0 commit comments

Comments
 (0)