From da01881004b963d75a6add2ab7dce139ac822a5d Mon Sep 17 00:00:00 2001 From: "Douglas R. Miles" Date: Fri, 29 Nov 2024 17:42:09 -0800 Subject: [PATCH] Update README.md --- .../compare_algo/nqueens/README.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/performance/compare_algo/nqueens/README.md b/tests/performance/compare_algo/nqueens/README.md index f8cc7c9db88..f78cb42c77a 100644 --- a/tests/performance/compare_algo/nqueens/README.md +++ b/tests/performance/compare_algo/nqueens/README.md @@ -8,8 +8,8 @@ | **7** | 40 | 0.197 | 11.435 | 0.000098 | 0.000 | 0.003 | 0.000 | | **8** | 92 | 0.292 | 38.588 | 0.000100 | 0.000 | 0.015 | 0.000 | | **9** | 352 | 0.325 | 133.000 | 0.000200 | 0.000083 | 0.061 | 0.000 | -| **10** | 724 | 0.588 | 467.000 | 0.110 | 0.000167 | 0.267 | 0.000 | -| **11** | 2,680 | 0.750 | - | - | 0.000433 | 1.276 | 0.000167 | +| **10** | 724 | 0.488 | 467.000 | 0.110 | 0.000167 | 0.267 | 0.000 | +| **11** | 2,680 | 0.750 | - | - | 0.000433 | 1.276 | 0.000167 | | **12** | 14,200 | - | - | 0.415 | 0.003683 | 6.664 | 0.000917 | | **13** | 73,712 | - | - | - | 0.011817 | 36.606 | 0.005133 | | **14** | 365,596 | - | - | - | 0.186467 | 212.653 | 0.030817 | @@ -20,23 +20,25 @@ ### **Key Observations** #### **1. MeTTaRust Performance** -- **MeTTaRust** is consistent and correct with **467.000 minutes (~7.783 hours)** for **N=10**. -- Its performance declines significantly with increasing N, highlighting the need for optimizations or alternative approaches. +- **MeTTaRust** is consistent, taking **467 minutes (~7.783 hours)** for **N=10**. However, its performance degrades significantly as N increases, highlighting the need for optimizations or alternative strategies. -#### **2. MeTTaLog and Transpiled MeTTaLog** -- **MeTTaLog** scales poorly for larger N, taking **25.388 minutes (~1.5 hours)** for **N=10**. -- **Transpiled MeTTaLog** continues to perform exceptionally well, solving **N=10** in just **0.11 minutes (~6.6 seconds)** and **N=12** in **0.415 minutes (~24.9 seconds)**. +#### **2. Interpreted MeTTaLog and Transpiled MeTTaLog** +- **Interpreted MeTTaLog** scales poorly, taking **0.488 minutes (~29.3 seconds)** for **N=10**, making it impractical for larger problem sizes. +- **Transpiled MeTTaLog** achieves exceptional speed, consistently running about **2000x faster than Interpreted MeTTaLog**. #### **3. Plain Prolog vs. CLP(FD)** -- **Plain Prolog** outperforms **CLP(FD)** for larger N (e.g., N ≥ 12) due to the reduced overhead of backtracking compared to domain pruning. -- **CLP(FD)** remains superior for small-to-medium N (e.g., N ≤ 10) due to its efficient constraint handling. +- **Plain Prolog** outperforms **CLP(FD)** for larger N (e.g., N ≥ 12) due to its simpler backtracking, which incurs less overhead. +- **CLP(FD)** is superior for small-to-medium N (e.g., N ≤ 10) because of its efficient constraint propagation and domain pruning, but its complexity becomes a liability as N grows. #### **4. C/C++** -- C/C++ maintains its dominance as the fastest implementation, solving even **N=15** in under **12 seconds (0.196 minutes)**. +- C/C++ remains the fastest implementation, solving even the largest tested size, **N=15**, in under **12 seconds (0.196 minutes)**. --- ### **Takeaways** - - **C/C++ and Transpiled MeTTaLog** are the fastest implementations, with C/C++ leading for all N and Transpiled MeTTaLog excelling among symbolic reasoning tools. - - **Prolog CLP(FD)** is not a magic bullet for some problems. +1. **Fastest Implementations:** + - **C/C++ and Transpiled MeTTaLog** are the fastest implementations overall, with C/C++ leading for all N and **Transpiled MeTTaLog** excelling as a symbolic reasoning tool. + +2. **Prolog CLP(FD) Not Always Optimal:** + - Despite its powerful constraint-handling capabilities, **CLP(FD)** struggles with larger N, where its overhead surpasses the benefits of domain pruning.