Supplementary code for:
J. F. A. Madeira, Mixed-Variable Optimisation as a Metric Product Space: Transient Categorical Geometry and a Hierarchy of Local Optimality, manuscript JOGO-D-26-00103, revised version.
The repository supports two parts of the manuscript:
- Appendix A / Proposition 5.4: deterministic generation and independent verification of minimal covering families of cyclic orderings.
- Section 6.3 / Table 4 / Figure 6: the controlled mixed-variable computational illustration under categorical relabellings.
coverings/
generate_coverings.py Python generator for minimal covering families
verify_coverings.py Independent verification of Appendix A.3
generate_coverings.m MATLAB/Octave generator
verify_coverings.m MATLAB/Octave verification
experiment/
mixed_experiment.py Python reference implementation for Section 6.3
mixed_experiment.m MATLAB/Octave implementation
make_figure.py Regenerates Figure 6
fig_convergence_A.pdf Figure used in the revised manuscript
tests/
test_repository.py Coverage and Table 4 regression tests
Python 3.10 or later is recommended. The numerical experiment and covering tools use only the standard library.
# Verify the explicit Appendix A.3 families
python coverings/verify_coverings.py
# Generate minimal covering families for k = 3,...,10
python coverings/generate_coverings.py
# Generate one family
python coverings/generate_coverings.py 12 12
# Reproduce Table 4 and write JSON results
python experiment/mixed_experiment.py --output-dir results --validateTo regenerate Figure 6:
python -m pip install -r requirements-figure.txt
python experiment/make_figure.py \
--input results/traces_A.json \
--output results/fig_convergence_A.pdfMATLAB / GNU Octave:
addpath('coverings', 'experiment')
verify_coverings
cycles = generate_coverings(8)
mixed_experimentThe Python reference implementation reproduces the manuscript values:
| Instance | Treatment | Success | Final value (mean ± std) | Distinct evaluations |
|---|---|---|---|---|
| A | integer adjacency | 0.175 | 3.950 ± 2.487 | 95 |
| A | full polling | 1.000 | 0.000 ± 0.000 | 189 |
| A | rotating cyclic | 1.000 | 0.000 ± 0.000 | 124 |
| A | random neighbour | 1.000 | 0.024 ± 0.083 | 553 |
| B | integer adjacency | 0.250 | 3.913 ± 2.552 | 87 |
| B | full polling | 1.000 | 0.000 ± 0.000 | 164 |
| B | rotating cyclic | 1.000 | 0.000 ± 0.000 | 135 |
| B | random neighbour | 1.000 | 0.000 ± 0.000 | 197 |
- The 40 relabellings are fixed explicitly in both implementations.
- Every run starts at the label carrying the same underlying category.
- Distinct function evaluations are counted through a cache; repeated trial requests do not increase the count.
- Full polling and rotating cyclic termination certificates are asserted programmatically.
- The deterministic treatments produce the same reported rows in Python and MATLAB/Octave.
- The random baseline uses different portable random generators in the two languages. Table 4 reports the Python values.
- Figure rendering can vary slightly with the Matplotlib version, but it is generated from the same saved trace data.
For a categorical set of size k, the minimum family size is
[ M = \left\lceil\frac{k-1}{2}\right\rceil. ]
- For odd
k, the generator uses a Walecki Hamiltonian decomposition. - For even
k, it uses the round-robin circle method and pairs perfect matchings to form Hamiltonian cycles.
The verifier checks minimal family size, validity of every permutation, full pairwise coverage, the repetition count in Remark 5.6, and agreement of the k=8 family with the Section 6.3 schedule.
python -m unittest discover -s tests -vGitHub Actions runs these checks on Python 3.10, 3.11, and 3.13 and regenerates Figure 6 as an artifact.
Use GitHub's Cite this repository button, generated from CITATION.cff. A software DOI should be added after the first archived GitHub release.
MIT. See LICENSE.
The original root-level commands (generate_orderings.py, verify_orderings.py and their MATLAB counterparts) are retained as thin compatibility wrappers. New work should use the scripts in coverings/.