{"id":19876704,"url":"https://github.com/dirktoewe/selx","last_synced_at":"2026-06-10T00:31:32.820Z","repository":{"id":176082579,"uuid":"179323992","full_name":"DirkToewe/SelX","owner":"DirkToewe","description":"Selection Algorithms for Scala","archived":false,"fork":false,"pushed_at":"2019-04-04T22:00:53.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T05:35:08.498Z","etag":null,"topics":["scala","selection-algorithms"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DirkToewe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-03T15:59:53.000Z","updated_at":"2019-10-21T05:37:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed1649c9-f286-423a-902a-fb395f7dfb31","html_url":"https://github.com/DirkToewe/SelX","commit_stats":null,"previous_names":["dirktoewe/selx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DirkToewe%2FSelX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DirkToewe%2FSelX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DirkToewe%2FSelX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DirkToewe%2FSelX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DirkToewe","download_url":"https://codeload.github.com/DirkToewe/SelX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304294,"owners_count":19941101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scala","selection-algorithms"],"created_at":"2024-11-12T16:33:58.511Z","updated_at":"2026-06-10T00:31:32.812Z","avatar_url":"https://github.com/DirkToewe.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"SelX is an exploratory project that compares the performance and efficiency of different\n[Selection Algorithms](https://en.wikipedia.org/wiki/Selection_algorithm). As a baseline\nthe algorithms are also compared to `java.util.Arrays.sort`. The benchmark results for random\nuniform boxed Double inputs can be found [here](https://dirktoewe.github.io/SelX/benchmark_boxed.html).\nSelX implements multiple evolutions of the following Selection Algorithms:\n\n\u003cdl\u003e\n\u003cdt\u003eBubble Select\u003cdd\u003e\n  Inspired by \u003ca href=\"https://en.wikipedia.org/wiki/Bubble_sort\"\u003eBubble Sort\u003c/a\u003e. Moves the maxima\n  from the left side to the right until the Selection property is instated.\n\u003cdt\u003eHeap Select\u003cdd\u003e\n  Builds a \u003ca href=\"https://en.wikipedia.org/wiki/Binary_heap\"\u003eBinary Heap\u003c/a\u003e on the larger\n  of the two sides and swaps with the other side until the Selection property is instated.\n\u003cdt\u003eMedian-of-Medians (MoM)\u003cdd\u003e\n  Splits the input into small groups of 3 (MoM3) or 5 (MoM5) entries, computes the median\n  of each groups. Of these medians, the median is computed by calling MoM recursively. This\n  median is then used to split/pivotize the original input into two parts. The entire procedure\n  is repeated on the correct one of the two parts recursively. MoM5 is guaranteed O(n).\n\u003cdt\u003eMedian-of-Medians-of-Medians (MoMoM3)\u003cdd\u003e\n  Also known as repeated step algorithm. Splits the input into groups of 3 and computes their\n  median. Those medians are again split into groups of 3, their median is computed. Of those\n  medians, the median is computed by recursively calling MoMoM3. That one resulting median\n  is then used to split/pivotize the original input into two parts. The entire procedure\n  is repeated on the correct one of the two parts recursively. MoMoM3 is guaranteed\n  O(n) and slightly faster than MoM5.\n\u003cdt\u003eQuick Select\u003cdd\u003e\n  Chooses a random entry from the input and uses it to split/pivotize the input. This is done\n  recursively until the Selection property is instated.\n\u003cdt\u003eMean Select\u003cdd\u003e\n  Like Quick Select but uses the mean value of th inputs to split/pivotize. (Requires numeric keys).\n\u003c/dl\u003e\n\nMost of the algorithms have been incrementally tweaked and optimized. The most effectful\noptimizations were taken from [this paper](https://arxiv.org/abs/1606.00484):\n  * Use the median of three random values as pivot for Quick Select\n  * Avoid splitting/pivotizing the medians of the groups a second time\n  * Instead of just selecting the median of the medians, select another index of the medians\n    if it guarantees a better reduction of the problem size while splitting/pivotizing.\n\nRunning the Benchmarks\n----------------------\nTo run a quick benchmark that will automatically generate HTML plots of the results, use sbt to call:\n```\ntest:runMain test:runMain selx.Select_comparison\n```\n\nTo run the proper [JMH](https://openjdk.java.net/projects/code-tools/jmh/) benchmarks, which may take roughly 24 hours, run:\n```\njmh:run\n```\n\nTo run only the unboxed or boxed JMH benchmark, run:\n```\njmh:run selx.Select_benchmarks_double\n```\nor:\n```\njmh:run selx.Select_benchmarks_boxed\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirktoewe%2Fselx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirktoewe%2Fselx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirktoewe%2Fselx/lists"}