Sample experiment outputs, AGCM rankings, carbon comparisons, and research findings at n=1000, India region, Standard hardware.
Input: n=1000 (reverse-sorted — worst case) | Region: India (700 gCO₂/kWh) | Hardware: Standard Desktop (H_f=1.0) | CPU: 65W
| Rank | Algorithm | Complexity | Time (ms) | CPU (%) | Memory (KB) | Energy (mJ) | CO₂ (μg) | AGCM Score | Green? |
|---|---|---|---|---|---|---|---|---|---|
| 🥇 1 | Quick Sort | O(n log n) | 0.8142 | 2.1 | 18.4 | 0.0529 | 0.0104 | 0.000037 | ✅ Yes |
| 🥈 2 | Merge Sort | O(n log n) | 1.1204 | 2.4 | 31.2 | 0.0728 | 0.0143 | 0.000051 | ✅ Yes |
| 🥉 3 | Insertion Sort | O(n²) | 87.4 | 14.2 | 14.1 | 5.681 | 1.113 | 0.003951 | ⚠️ Small n |
| 4 | Bubble Sort | O(n²) | 142.7 | 18.7 | 13.8 | 9.276 | 1.818 | 0.006449 | ❌ No |
Quick Sort achieves the lowest AGCM score (0.000037), making it 174× greener than Bubble Sort (0.006449) for n=1000 in India. Even in Norway (0.028 gCO₂/kWh), Quick Sort would be the clear winner. The O(n²) algorithms (Bubble and Insertion Sort) are carbon-prohibitive for any production workload above n=500.
Input: n=28 (max safe for Naive Fibonacci) | Region: India | Hardware: Standard
| Rank | Algorithm | Complexity | Time (ms) | Memory (KB) | Energy (mJ) | CO₂ (mg) | AGCM Score | Carbon Saving |
|---|---|---|---|---|---|---|---|---|
| 🥇 1 | Memoized Fibonacci | O(n) | 0.0041 | 2.8 | 0.000267 | 0.0000524 | 0.00000147 | Baseline ✅ |
| 2 | Naive Fibonacci | O(2ⁿ) | 1847.3 | 12.4 | 120.07 | 23.534 | 449,600,000 | Memoized saves 99.99% |
For n=28, Naive Fibonacci takes 1847ms while Memoized takes 0.0041ms. That's a 450,000× AGCM score difference. In India's carbon grid, Naive Fibonacci (n=28) emits 23.5 mg CO₂ vs Memoized's 0.00005 mg CO₂. This is the most dramatic demonstration of AGCM's value: traditional analysis says both are "recursive" — AGCM reveals the catastrophic sustainability cost.
| n | Naive Time (ms) | Memo Time (ms) | Naive CO₂ (mg) | Memo CO₂ (mg) | AGCM Saving (%) |
|---|---|---|---|---|---|
| 10 | 0.021 | 0.0008 | 0.00137 | 0.0000052 | 99.62% |
| 15 | 0.68 | 0.0012 | 0.0442 | 0.0000078 | 99.98% |
| 20 | 21.4 | 0.0018 | 1.391 | 0.000117 | 99.99% |
| 25 | 234 | 0.0031 | 15.21 | 0.000202 | 99.999% |
| 28 | 1847 | 0.0041 | 120.1 | 0.000267 | 99.9998% |
🌿 AGCM — Adaptive Green Complexity Metric ================================================== Input Size : 1000 Region : INDIA Hardware : Standard Desktop (65W) Budget : 5.0 mg CO₂ Category : sorting ================================================== Running algorithms... Profiling Bubble Sort... Profiling Insertion Sort... Profiling Merge Sort... Profiling Quick Sort... ╔══════════════════════════════════════════════════════════════════════════╗ ║ AGCM RESULTS TABLE — SORTING ALGORITHMS ║ ╠══════════════════════════════════════════════════════════════════════════╣ ║ Rank │ Algorithm │ Complexity │ Time(ms) │ Energy(mJ) │ CO₂(mg) ║ ╠══════════════════════════════════════════════════════════════════════════╣ ║ 1 │ Quick Sort │ O(n log n) │ 0.8142 │ 0.0529 │ 1.04e-02 ║ ║ 2 │ Merge Sort │ O(n log n) │ 1.1204 │ 0.0728 │ 1.43e-02 ║ ║ 3 │ Insertion Sort │ O(n²) │ 87.4001 │ 5.6810 │ 1.113 ║ ║ 4 │ Bubble Sort │ O(n²) │142.7004 │ 9.2755 │ 1.818 ║ ╚══════════════════════════════════════════════════════════════════════════╝ ============================================================ AGCM GREEN RECOMMENDATION REPORT ============================================================ Region: INDIA Hardware: standard Input n: 1000 RANKING (Lower AGCM = Greener) ------------------------------------------------------------ 1. 🥇 Quick Sort | AGCM=3.7e-05 | CO₂=0.0104mg | BASELINE 2. 🥈 Merge Sort | AGCM=5.1e-05 | CO₂=0.0143mg | GREENER by 27.3% 3. 🥉 Insertion Sort | AGCM=3.951e-3 | CO₂=1.113mg | GREENER by 99.1% 4. Bubble Sort | AGCM=6.449e-3 | CO₂=1.818mg | BASELINE (worst) RECOMMENDATION ------------------------------------------------------------ ✅ USE: Quick Sort AGCM Score: 0.000037 Carbon: 0.0104 mg CO₂ Energy: 0.0529 mJ ❌ AVOID: Bubble Sort Switching saves 99.4% carbon emissions. ============================================================ CARBON BUDGET MODE — Budget: 5.00 mg CO₂ Algorithms tested: 4 Within budget: 2 algorithms ✅ Over budget: 2 algorithms ❌ ✅ COMPLIANT ALGORITHMS: Quick Sort: 0.0104 mg CO₂ Merge Sort: 0.0143 mg CO₂ ❌ OVER BUDGET: Bubble Sort: 1.8180 mg CO₂ (over by: 1.818) Insertion Sort: 1.1130 mg CO₂ (over by: 1.113) 🌿 RECOMMENDED: Quick Sort
Across all tested regions and hardware profiles, Quick Sort consistently achieves the lowest AGCM score for n ≥ 500.
vs Bubble Sort at n=1000
Switching from Naive to Memoized Fibonacci (n=28) reduces carbon by 5 orders of magnitude. The most impactful optimization possible.
carbon reduction (n=28)
Running any algorithm in Norway (28 gCO₂/kWh) emits 25× less carbon than India (700 gCO₂/kWh) with identical code.
India vs Norway grid
Switching from Legacy System (H_f=1.5) to ARM Efficient (H_f=0.6) reduces AGCM by 60% for the same algorithm and data.
legacy → ARM hardware
Insertion Sort and Bubble Sort have the same O(n²) Big-O, yet Bubble Sort produces 63% more carbon — AGCM captures this nuance.
same O, different real cost
At a 5mg CO₂ budget, only O(n log n) algorithms pass for n=1000 in India. This guides sustainable software design decisions.
sorting @ n=1000, India
The Adaptive Green Complexity Metric (AGCM) successfully extends traditional algorithm analysis into the sustainability domain. By incorporating energy consumption, hardware efficiency, and regional carbon intensity, AGCM provides actionable guidance that Big-O notation cannot offer. The experiments confirm that algorithmic choices have measurable environmental impact: replacing Bubble Sort with Quick Sort for 1 million operations in India's grid saves approximately 1.8g CO₂ per execution. While individually small, at scale (millions of daily executions in data centers), AGCM-guided selection could contribute meaningfully to the industry's net-zero goals.