diff --git a/data/WonkyComparator/deck_shuffle_errors_comparison_wonky.txt b/data/WonkyComparator/deck_shuffle_errors_comparison_wonky.txt new file mode 100644 index 0000000..ae272a2 --- /dev/null +++ b/data/WonkyComparator/deck_shuffle_errors_comparison_wonky.txt @@ -0,0 +1,14 @@ +Average card displacement over 1000 runs for each algorithm on lists of +56 cards (integers) with a card comparator that gives a random result 10% of +the time +========================================================== +Mergesort Errors: 202 +Quicksort Errors: 201 +Bubblesort Errors: 4 +TensortBL Errors: 51 +RobustsortP Errors: 15 +RobustsortB Errors: 11 +RobustsortM Errors: 1 +RobustsortRP Errors: 13 +RobustsortRB Errors: 8 +RobustsortRM Errors: 2 diff --git a/data/WonkyComparator/large_comparison_wonky.txt b/data/WonkyComparator/large_comparison_wonky.txt new file mode 100644 index 0000000..b5385c3 --- /dev/null +++ b/data/WonkyComparator/large_comparison_wonky.txt @@ -0,0 +1,149 @@ +Single run time elapsed and average element displacement +over 100 runs for each algorithm on lists of integers of +length n with an element comparator that gives a random +result 10% of the time +========================================================== + Algorithm | Time | Score | n = 8 + Mergesort | 0.000031449s | 3 | + Quicksort | 0.000010409s | 3 | + Bubblesort | 0.000031339s | 0 | + TensortBL | 0.000033613s | 1 | + RobustsortP | 0.000045666s | 0 | + RobustsortB | 0.000033643s | 0 | + RobustsortM | 0.000041718s | 0 | + RobustsortRP | 0.000088796s | 0 | + RobustsortRB | 0.000075191s | 0 | + RobustsortRM | 0.000086171s | 0 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 16 + Mergesort | 0.000013054s | 14 | + Quicksort | 0.000009417s | 15 | + Bubblesort | 0.000059402s | 1 | + TensortBL | 0.000055594s | 6 | + RobustsortP | 0.000089748s | 1 | + RobustsortB | 0.00008043s | 0 | + RobustsortM | 0.000100989s | 0 | + RobustsortRP | 0.000203711s | 0 | + RobustsortRB | 0.000197609s | 0 | + RobustsortRM | 0.000211665s | 0 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 32 + Mergesort | 0.000025838s | 64 | + Quicksort | 0.000018825s | 69 | + Bubblesort | 0.000354664s | 2 | + TensortBL | 0.000142116s | 20 | + RobustsortP | 0.000220602s | 4 | + RobustsortB | 0.00019793s | 3 | + RobustsortM | 0.000254476s | 0 | + RobustsortRP | 0.0005989s | 4 | + RobustsortRB | 0.000600803s | 3 | + RobustsortRM | 0.000646549s | 0 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 64 + Mergesort | 0.000055654s | 265 | + Quicksort | 0.000041277s | 300 | + Bubblesort | 0.002297067s | 4 | + TensortBL | 0.000456134s | 59 | + RobustsortP | 0.000551952s | 19 | + RobustsortB | 0.000516175s | 13 | + RobustsortM | 0.000666727s | 4 | + RobustsortRP | 0.002157896s | 16 | + RobustsortRB | 0.002016001s | 13 | + RobustsortRM | 0.002166592s | 2 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 128 + Mergesort | 0.000121037s | 1130 | + Quicksort | 0.000091542s | 1053 | + Bubblesort | 0.016473453s | 11 | + TensortBL | 0.001020198s | 247 | + RobustsortP | 0.001257431s | 95 | + RobustsortB | 0.001325068s | 51 | + RobustsortM | 0.001560928s | 17 | + RobustsortRP | 0.005066665s | 68 | + RobustsortRB | 0.005192839s | 47 | + RobustsortRM | 0.00518222s | 19 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 256 + Mergesort | 0.000270485s | 4666 | + Quicksort | 0.000194895s | 4112 | + Bubblesort | 0.125792888s | 28 | + TensortBL | 0.003069248s | 792 | + RobustsortP | 0.003116046s | 317 | + RobustsortB | 0.003281486s | 241 | + RobustsortM | 0.003792913s | 61 | + RobustsortRP | 0.012978649s | 258 | + RobustsortRB | 0.013403694s | 155 | + RobustsortRM | 0.013466592s | 53 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 512 + Mergesort | 0.000590213s | 19355 | + Quicksort | 0.000441095s | 15842 | + Bubblesort | 1.107719339s | 79 | + TensortBL | 0.008450123s | 2582 | + RobustsortP | 0.006841444s | 1363 | + RobustsortB | 0.007447098s | 865 | + RobustsortM | 0.008897289s | 193 | + RobustsortRP | 0.035905499s | 1138 | + RobustsortRB | 0.037010417s | 876 | + RobustsortRM | 0.039570233s | 160 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 1024 + Mergesort | 0.001287126s | 77637 | + Quicksort | 0.001012112s | 64753 | + Bubblesort | 8.83146598s | 212 | + TensortBL | 0.020115045s | 10193 | + RobustsortP | 0.014715055s | 5788 | + RobustsortB | 0.016441053s | 3976 | + RobustsortM | 0.019110225s | 806 | + RobustsortRP | 0.090961052s | 4484 | + RobustsortRB | 0.091372881s | 3163 | + RobustsortRM | 0.096884486s | 558 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 2048 + Mergesort | 0.002706653s | 319199 | + Quicksort | 0.002206037s | 269252 | + Bubblesort | 67.229769894s | 707 | + TensortBL | 0.056649886s | 34223 | + RobustsortP | 0.036861441s | 21177 | + RobustsortB | 0.038692015s | 18025 | + RobustsortM | 0.046679795s | 3255 | + RobustsortRP | 0.229615609s | 15254 | + RobustsortRB | 0.22648706s | 10147 | + RobustsortRM | 0.249211013s | 1824 | +---------------------------------------------------------- + Note: after this point Bubblesort is omitted from the + results due to its long run time +---------------------------------------------------------- + Algorithm | Time | Score | n = 4096 + Mergesort | 0.006077793s | 1277538 | + Quicksort | 0.005398393s | 1047130 | + TensortBL | 0.159859188s | 123560 | + RobustsortP | 0.084122461s | 87496 | + RobustsortB | 0.087930914s | 68214 | + RobustsortM | 0.105430827s | 12660 | + RobustsortRP | 0.535468964s | 66074 | + RobustsortRB | 0.567415965s | 46761 | + RobustsortRM | 0.616807445s | 5922 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 8192 + Mergesort | 0.013603697s | 5115761 | + Quicksort | 0.012066814s | 4335394 | + TensortBL | 0.484234314s | 457669 | + RobustsortP | 0.215196709s | 359897 | + RobustsortB | 0.224570539s | 276027 | + RobustsortM | 0.261256298s | 52303 | + RobustsortRP | 1.412261999s | 286303 | + RobustsortRB | 1.460227814s | 196659 | + RobustsortRM | 1.570891199s | 25736 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 16384 + Mergesort | 0.030196538s | 20533658 | + Quicksort | 0.029216759s | 17064001 | + TensortBL | 1.012220358s | 1812368 | + RobustsortP | 0.563116432s | 1427610 | + RobustsortB | 0.589861936s | 1090989 | + RobustsortM | 0.664186576s | 200300 | + RobustsortRP | 2.804235108s | 1144749 | + RobustsortRB | 2.927166582s | 782040 | + RobustsortRM | 3.036211048s | 105231 | +---------------------------------------------------------- diff --git a/data/WonkyStuckComparator/deck_shuffle_errors_comparison_wonky_stuck.txt b/data/WonkyStuckComparator/deck_shuffle_errors_comparison_wonky_stuck.txt new file mode 100644 index 0000000..9632f47 --- /dev/null +++ b/data/WonkyStuckComparator/deck_shuffle_errors_comparison_wonky_stuck.txt @@ -0,0 +1,14 @@ +Average card displacement over 1000 runs for each algorithm on lists of +56 cards (integers) with a card comparator that gives a random result 10% of +the time and repeats its previous answer 50% of the time +========================================================== +Mergesort Errors: 747 +Quicksort Errors: 601 +Bubblesort Errors: 97 +TensortBL Errors: 451 +RobustsortP Errors: 479 +RobustsortB Errors: 391 +RobustsortM Errors: 311 +RobustsortRP Errors: 436 +RobustsortRB Errors: 320 +RobustsortRM Errors: 292 diff --git a/data/WonkyStuckComparator/large_comparison_stuck_wonky.txt b/data/WonkyStuckComparator/large_comparison_stuck_wonky.txt new file mode 100644 index 0000000..6cf7e1d --- /dev/null +++ b/data/WonkyStuckComparator/large_comparison_stuck_wonky.txt @@ -0,0 +1,163 @@ +Single run time elapsed and average element displacement +over 100 runs for each algorithm on lists of integers of +length n with an element comparator that gives both a +random result 10% of the time and repeats the previous +result 50% of the time. +========================================================== + Algorithm | Time | Score | n = 8 + + Mergesort | 0.000032251s | 14 | + Quicksort | 0.000010649s | 12 | + Bubblesort | 0.000034906s | 6 | + TensortBL | 0.000032702s | 10 | + RobustsortP | 0.000049584s | 8 | + RobustsortB | 0.000051066s | 6 | + RobustsortM | 0.000050816s | 5 | + RobustsortRP | 0.00010599s | 8 | + RobustsortRB | 0.000092084s | 6 | + RobustsortRM | 0.000119836s | 6 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 16 + + Mergesort | 0.000012613s | 60 | + Quicksort | 0.000010099s | 47 | + Bubblesort | 0.00006388s | 18 | + TensortBL | 0.000054552s | 54 | + RobustsortP | 0.000112221s | 41 | + RobustsortB | 0.000160473s | 31 | + RobustsortM | 0.000177856s | 29 | + RobustsortRP | 0.000210056s | 43 | + RobustsortRB | 0.000183516s | 31 | + RobustsortRM | 0.000313051s | 28 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 32 + + Mergesort | 0.000025257s | 240 | + Quicksort | 0.000021651s | 201 | + Bubblesort | 0.000369287s | 41 | + TensortBL | 0.000168798s | 195 | + RobustsortP | 0.000276081s | 142 | + RobustsortB | 0.000330023s | 117 | + RobustsortM | 0.000390306s | 96 | + RobustsortRP | 0.000711242s | 146 | + RobustsortRB | 0.000704069s | 105 | + RobustsortRM | 0.00082642s | 99 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 64 + + Mergesort | 0.000057719s | 971 | + Quicksort | 0.000045095s | 808 | + Bubblesort | 0.002554923s | 117 | + TensortBL | 0.000426495s | 571 | + RobustsortP | 0.00061976s | 654 | + RobustsortB | 0.000808996s | 506 | + RobustsortM | 0.001188904s | 420 | + RobustsortRP | 0.002313266s | 576 | + RobustsortRB | 0.002420409s | 420 | + RobustsortRM | 0.002693795s | 362 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 128 + + Mergesort | 0.000138482s | 4062 | + Quicksort | 0.000101882s | 3228 | + Bubblesort | 0.018920403s | 369 | + TensortBL | 0.001005007s | 2207 | + RobustsortP | 0.001521762s | 2818 | + RobustsortB | 0.001873687s | 2305 | + RobustsortM | 0.002396353s | 1808 | + RobustsortRP | 0.005501404s | 2391 | + RobustsortRB | 0.005889857s | 1720 | + RobustsortRM | 0.006245249s | 1420 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 256 + + Mergesort | 0.000262726s | 16098 | + Quicksort | 0.00022796s | 12875 | + Bubblesort | 0.140008324s | 1294 | + TensortBL | 0.003059445s | 9378 | + RobustsortP | 0.003879824s | 10793 | + RobustsortB | 0.004592999s | 8992 | + RobustsortM | 0.006356689s | 7220 | + RobustsortRP | 0.01350889s | 10893 | + RobustsortRB | 0.015709562s | 7740 | + RobustsortRM | 0.017035926s | 6305 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 512 + + Mergesort | 0.00061964s | 65457 | + Quicksort | 0.000459388s | 51708 | + Bubblesort | 1.470609003s | 5380 | + TensortBL | 0.008260523s | 32057 | + RobustsortP | 0.008339361s | 44974 | + RobustsortB | 0.010348875s | 36285 | + RobustsortM | 0.015314012s | 28404 | + RobustsortRP | 0.038752864s | 41821 | + RobustsortRB | 0.042059256s | 31896 | + RobustsortRM | 0.052783839s | 22845 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 1024 + + Mergesort | 0.001331684s | 264525 | + Quicksort | 0.001033171s | 208115 | + Bubblesort | 13.452793768s | 21047 | + TensortBL | 0.019672577s | 116840 | + RobustsortP | 0.017528235s | 192327 | + RobustsortB | 0.022825438s | 158334 | + RobustsortM | 0.031631765s | 122512 | + RobustsortRP | 0.093026058s | 162688 | + RobustsortRB | 0.10967526s | 126694 | + RobustsortRM | 0.131919203s | 90300 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 2048 + + Mergesort | 0.002660556s | 1062535 | + Quicksort | 0.002462854s | 840206 | + Bubblesort | 134.773207064s | 87977 | + TensortBL | 0.055963595s | 425961 | + RobustsortP | 0.042348373s | 731536 | + RobustsortB | 0.054674704s | 607912 | + RobustsortM | 0.082333458s | 479960 | + RobustsortRP | 0.237273315s | 626142 | + RobustsortRB | 0.274846319s | 491091 | + RobustsortRM | 0.346625435s | 333622 | + +---------------------------------------------------------- + Note: after this point Bubblesort is omitted from the + results due to its long run time +---------------------------------------------------------- + Algorithm | Time | Score | n = 4096 + + Mergesort | 0.005942043s | 4247423 | + Quicksort | 0.005394119s | 3319827 | + TensortBL | 0.153502134s | 1577063 | + RobustsortP | 0.09774953s | 3153973 | + RobustsortB | 0.119230294s | 2552633 | + RobustsortM | 0.173643397s | 1994121 | + RobustsortRP | 0.586039226s | 2687189 | + RobustsortRB | 0.692494727s | 2143171 | + RobustsortRM | 0.880613715s | 1314278 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 8192 + + Mergesort | 0.013548986s | 17041462 | + Quicksort | 0.013005352s | 13394776 | + TensortBL | 0.463169809s | 5988182 | + RobustsortP | 0.245367061s | 12007383 | + RobustsortB | 0.302308762s | 9898434 | + RobustsortM | 0.4208429s | 7951725 | + RobustsortRP | 1.531550402s | 10110706 | + RobustsortRB | 1.789757822s | 7809793 | + RobustsortRM | 2.201473668s | 5181672 | +---------------------------------------------------------- + Algorithm | Time | Score | n = 16384 + + Mergesort | 0.031012492s | 68160357 | + Quicksort | 0.029349454s | 53301096 | + TensortBL | 0.985868398s | 25078288 | + RobustsortP | 0.615555374s | 50410789 | + RobustsortB | 0.74278552s | 40235803 | + RobustsortM | 1.007819879s | 31488449 | + RobustsortRP | 3.144343233s | 42121317 | + RobustsortRB | 3.549654025s | 31376518 | + RobustsortRM | 4.252823697s | 20608983 | +---------------------------------------------------------- diff --git a/flake.nix b/flake.nix index 73e5615..662499d 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ ghc haskellPackages.cabal-install haskellPackages.doctest + zlib ]; shellHook = ''