Reduce Compact Letter Displays
Overview
Reduces compact letter displays (CLDs) of all pairwise comparisons. A CLD gives two groups a common letter exactly when they are not significantly different. The package finds a display with the fewest letter assignments that keeps every one of these relationships. This is the assignment-minimum clique covering problem of Ennis, Fayle, and Ennis (2012) doi:10.1145/2133803.2275596, solved as a mixed-integer linear program with 'HiGHS'. Among the displays with the fewest assignments, it returns one fixed canonical display, so the result does not depend on the solver. The package includes the wheat yield example of Piepho (2004) doi:10.1198/1061860043515.
First release of the R package. The repository now holds three packages that follow one specification (docs/algorithm.md) and pass one conformance suite (conformance/): the R package cldreducer at the repository root, the Python package cld-reducer in python/, and the JavaScript package cld-reducer in js/. All three solve the problem with HiGHS and return the same display for the same input.
R package
reduce_letters()reduces a compact letter display from pairwise comparisons, andreduce_from_adjacency()does the same from a matrix of non-significant pairs. Both return acld_reductionobject withprint()andas.data.frame()methods.- The example data sets are
piepho2004_wheat,simple_abc_pairs, andsimple_abc_means. - R turns HiGHS presolve off, because the highs package bundles HiGHS 1.14.
JavaScript package
- New npm package
cld-reducerinjs/, built on HiGHS compiled to WebAssembly:reduceLetters(),reduceFromAdjacency(),loadSolver(), and the error classesCldReducerError,InvalidInputError, andSolverError. Group means must be aMapor an array of{ group, mean }; a plain object is rejected.
Python package
- Preserve exact CSV labels, including leading zeros, NA-like text, and empty strings.
- Preserve mixed numeric labels in lists of pair rows and means mappings.
- Use one means-column rule for group order and values.
- Report uneven adjacency rows as
InvalidInputErrorwith the square-matrix message.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- The package moved to
python/. The import namecld_reducer, the public names, the exceptions, and thecld-reducecommand with its flags are unchanged. Installing from a git URL now needs#subdirectory=python:pip install "git+https://github.com/aigorahub/cld-reducer.git#subdirectory=python". - The solver is HiGHS through
highspy. The dependencies arehighspy,numpy, andpandas;scipyandnetworkxare gone. - **Canonical tie-break.** Many inputs have several displays with the same, smallest number of assignments (the Piepho 2004 wheat example has 64). The package now returns one fixed display: among all minimal displays, the one whose membership vector is lexicographically greatest in the order of the specification. The result no longer depends on which optimum the solver finds first, so R, Python, and JavaScript agree. For inputs with several minimal displays this can differ from version 0.1.0.
- **Canonical clique order.** Maximal cliques are now ordered by their sorted group indices, where 0.1.0 used the order of NetworkX. This order breaks ties between letters, so the letters can be renamed even for inputs that have only one minimal display. Example: five groups numbered 0 to 4, no means, and non-significant pairs 01, 02, 03, 04, 14, 24 have one minimal display; group 3 had
Ain 0.1.0 and hasCnow. stats["reduction_pct"]is not rounded any more; print it with the format you need. The example scripts print one decimal.stats["solver_status"]is the textOptimal, andstats["objective"]is a whole number.time_limitis one time budget for all solves of a call. Each solve gets the time that is left.- Group means must be finite numbers; a missing, infinite, or non-numeric mean is an
InvalidInputError. - A missing group label (
None,NaN,pd.NA, orpd.NaT) is anInvalidInputError, in the comparisons, the groups, and the means. - Means with a repeated group label are an
InvalidInputErrorforreduce_from_adjacency()too. - Significance text is trimmed of spaces, tabs, carriage returns, and line feeds only. Other white space, such as a no-break space, makes the value invalid.
- An empty list of comparisons is a table with zero rows, so the groups come from the means.
- A solver value that is not within 1e-6 of 0 or 1 is a
SolverError, also when the value is a whole number.
Release preparation
- Check installed Python wheels, wheels rebuilt from source distributions, and npm TypeScript consumers outside the checkout.
- Require manual tag-based publication with dry runs, version checks, artifact hashes, and separate npm/PyPI jobs.
- Record data reuse conditions and Python publication history as open release requirements.
From NEWS.md in the release
Install
Health
- OK11 OKNow
- OK5 OK2026-10-21
Documentation
- Help pages
- 5 (1 internal)includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 70%
- Return-value docs
- 100%
- Help pages citing references
- 20%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 0
Repository github.com/aigorahub/cld-reducer is linked, but repository-practices checks have not run for it yet.
Dependencies
Installing cldreducer adds 4 packages (4 with compiled code, 3.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, highs 1.7 MB, checkmate 247 KB.
Code & Tests
Datasets
People & History
- 0.2.0Latest2026-10-21 · current release ·
11 days in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-10 16:03 to 2026-10-21 10:55 UTC, in 59 readings. - RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-10-21
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Copyright
- See file COPYRIGHTS for example data sources and reuse status.
- Minimum R
- ≥ 4.0.0
- Bundled data
- 0.8 KB / 3 files
- Download size
- 25 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("cldreducer")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1145/2133803.2275596.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.