One generation: from evaluated solutions to a new population

COIN is an estimation-of-distribution algorithm for permutations. It does not cross two parents. It turns selected permutations into coincidence counts, updates a probabilistic weight model, and constructs the next population by sampling only unused items.

  1. EvaluateSend every permutation to the same evaluator. A single-objective run returns a scalar fitness; a multi-objective run returns an objective vector.
  2. SelectChoose a better tail as reward evidence and a worse tail as punishment evidence.
  3. CountTranslate each selected permutation into edge events, position–item events, or both, depending on the variant.
  4. LearnConservative learning redistributes integer weight; reconstruction learning rebuilds weights from the latest reward counts.
  5. SampleRoulette-sample from eligible unused items. Missing values and duplicates are impossible by construction.
  6. RepeatEvaluate the new population, update progress and archives, then create the next model snapshot.
+
Fair experimental time

Compare algorithms by objective evaluations, not generation count alone: evaluations = population size × effective generations.

The mathematical object being learned

Let a candidate permutation be π=(π₀,π₁,…,πₙ₋₁), where every item in {0,…,n−1} occurs exactly once. COIN does not assign an independent probability to each complete permutation—there are n! of them. Instead, it factorises useful evidence into a quadratic model. Edge variants use directed adjacency indicators; Node variants use position–item indicators.

Edge event

Eᵢⱼ(π)=1 when j immediately follows i in π. The current implementation also counts the closing relation from the final item back to the first, so one permutation contributes exactly n directed edge events.

E(i,j|π) = 1 if successorπ(i)=j; otherwise 0

Node/position event

Nₚⱼ(π)=1 when item j occupies position p. Every permutation contributes exactly one event to each position row and one event for each item.

N(p,j|π) = 1 if π[p]=j; otherwise 0

For reward set B and punishment set W, COIN forms count matrices R=Σπ∈B feature(π) and Q=Σπ∈W feature(π). The feature is E, N, or both. The evaluator can therefore change from TSP to Flow Shop, Sudoku or RNA while the model consumes the same selected-permutation interface.

Why quadratic memory is a deliberate compromise

A full joint distribution over permutations is intractable. An n×n coincidence model uses Θ(n²) memory and exposes a strong first-order learning signal. It cannot directly represent every long subsequence or higher-order dependency, but repeated sampling can assemble longer structures from compatible pairwise evidence. Hybrid variants extend this vocabulary without escalating to an exponential model.

Reward and punishment are selected evidence

With population 8 and reward/punishment ratios 25:25 in a minimization problem, the two lowest-fitness permutations reward the model and the two highest-fitness permutations punish it. The middle four are still evaluated and can update best-so-far, but they do not write model evidence in that generation.

REWARD · f=19[1,3,5,0,4,2]
REWARD · f=22[1,5,3,0,2,4]
MIDDLE · f=35[4,0,2,1,5,3]
PUNISH · f=50[2,4,5,1,0,3]
PUNISH · f=57[4,2,1,5,3,0]
+
Terminology: Reward selection ratio is the percentage of the population selected to learn positive evidence. It is not the number of selection rounds. Punishment selection ratio has the analogous negative-evidence meaning.

A complete worked generation

Assume n=6, minimization, population size 8, reward 25%, punishment 25%, and Conservative learning. Sorting fitness selects two reward and two punishment permutations. The learner then counts events—not objective values. A solution with fitness 19 and one with fitness 22 each contribute one vote per observed event; the fitness gap does not automatically give the first solution a larger vote.

1 · SORTrank 8 candidates
2 · SLICE2 reward + 2 punish
3 · COUNTR and Q matrices
4 · UPDATEinteger weights
5 · SAMPLE8 new orders

For Edge COIN, reward permutation [1,3,5,0,4,2] increments six cells. If the second reward permutation contains 1→5 rather than 1→3, both successor hypotheses receive support. Punishment counts identify transitions characteristic of poor solutions. Conservative updating then transfers available row mass without turning a legal transition into a permanent zero.

One illustrative row before and after evidencePrevious item = 1
successor02345row sum
before2020202020100
R count001012 events
Q count010102 events
after2018221822100
The numbers illustrate mass transfer; the production kernel applies its integer threshold and redistribution rules exactly.

Selection pressure and information quality

Very small reward sets learn aggressively from a few individuals and may lock onto accidental patterns. Very large sets dilute the distinction between strong and ordinary solutions. Punishment can accelerate rejection of repeatedly poor traits, but an excessive punishment fraction may suppress edges that are bad only in a particular context. Parameter grids should therefore report both quality and stability across seeds.

Edge COIN: learn what should follow what

Edge COIN stores an n×n matrix H[a,b]. Each cell is the integer sampling weight for placing item b after item a. The permutation [1,3,5,0,4,2] contributes directed events 1→3, 3→5, 5→0, 0→4, 4→2, and the cycle-closing edge 2→1.

Illustrative Edge weight matrix HRows = previous item · columns = following item
H0123
0012831
1901438
21635011
32910170
Diagonal transitions are forbidden. Every legal off-diagonal edge remains positive, preserving exploration.
STARTsample item 1
ROW H[1,*]mask used items
ROULETTEchoose 3
NEXT ROWH[3,unused]
RESULT[1,3,5,0,4,2]
+

Two learning modes

CONSERVATIVERedistribute massPunishment moves weight away from bad observed cells; reward draws available mass from row competitors into good cells. Historical information accumulates.
INITIAL SCALEround(n × 100 / training rate)Higher training rate means lower initial mass, therefore new evidence changes the distribution faster.
RECONSTRUCTIONH[i,j] = 10R[i,j] + 1Rebuild from the latest reward count. Unseen legal edges retain weight 1, so exploration is never completely closed.

Roulette sampling under a permutation constraint

The matrix row is not sampled over all columns. At construction step t, COIN creates an eligibility mask from items already used. It sums only eligible weights, draws an integer or floating threshold in that reduced total, and scans cumulative weight until the threshold is crossed. After selection, that item becomes ineligible for every later step.

eligible = not_used AND legal_for_problem
total = sum(weight[row,j] for j in eligible)
r = random(0,total)
next = first j whose cumulative eligible weight exceeds r
used[next] = true

This conditional renormalisation changes as the permutation grows. A high-weight successor may be unavailable because it was selected earlier, so lower-ranked alternatives remain important. Positive minimum weights are therefore not cosmetic: they keep a feasible completion path available when preferred edges conflict.

Readable and optimized implementations

The library contains an independently readable ReferenceEdgeCoin and an optimized NumPy/Numba implementation. Equivalence tests compare initialized weights, seeded populations, reward and punishment counts, updated matrices and generation records. Optimization is accepted only after behavior is shown to match—not merely because final fitness looks similar.

Node/Position models: NB-COIN and CNB-COIN

NB-COIN

Stores W[position,item]. Before sampling, it shuffles the order in which positions are filled. At each chosen position it roulette-samples an unused item from that position row. Random position order reduces the construction bias of always filling left to right.

positions = shuffle(0..n-1)
for p in positions:
    x[p] ~ W[p, unused]

CNB-COIN

Uses the same position–item matrix and learner, but visits positions 0,1,…,n−1. This is Chained Node-Based COIN: the construction sequence is explicit, stable and reproducible.

for p in range(n):
    x[p] ~ W[p, unused]
+

Both versions learn position coincidences, but their sampling order is not equivalent. This distinction matters when early choices consume values that later positions also strongly prefer.

Position model W[p,item]Rows = locus · columns = candidate item
positionitem 0item 1item 2item 3
08351116
11491731
210132912
33215918
Unlike Edge H, the diagonal has no special meaning. Every row represents a locus, not a predecessor.

Why NB and CNB may diverge despite sharing W

Suppose positions 0 and 5 both strongly prefer item 1. NB-COIN may fill position 5 first and consume item 1; CNB-COIN always gives position 0 first access. Thus the factorized matrix alone does not fully determine the generated distribution—the order of conditional sampling is part of the algorithm. Reporting only “Node-based COIN” would hide this experimental variable.

SNE-COIN

Pure Edge COIN represents transitions strongly but does not give a unique probabilistic role to the first position. SNE-COIN adds a vector S[item] for the first member and retains H[a,b] for subsequent transitions.

START MODELx[0] ~ S[unused]
EDGE MODELx[p] ~ H[x[p−1],unused]
VALID ORDERrepair-free permutation

This model is useful when the first locus has semantics: a depot, starting city, seed node, initial job or boundary condition.

Two Node–Edge hybrids, two different schemas

HYBRID TEMPLATE COIN

Node anchors → Edge completion

  1. Generate a full Node/Position template.
  2. Retain scattered 30–70% of its loci; locus 0 is always retained.
  3. Reserve values required by future anchors.
  4. Fill holes from the Edge row of the preceding selected item.
  5. Train both Node and Edge models from the completed population.
template: [1,_,3,_,_,6,_,7,_]
complete: [1,9,3,5,4,6,8,7,2]
HYBRID CHAIN COIN

Node or Edge at every link

Position 0 always comes from the Node model. Every later locus independently chooses its source: W[position,item] or H[previous,item]. A source mask records which model generated each locus.

x[0] ~ W[0,unused]
for p = 1..n-1:
  if Bernoulli(.5):
      x[p] ~ W[p,unused]
  else:
      x[p] ~ H[x[p-1],unused]
+
They are not duplicates

HNE-COIN freezes a partial schema and reconstructs around it. CNE-COIN has no pre-frozen template; it chooses the model independently at each link during construction.

Choosing a representation from problem semantics

Adjacency dominates

Use Edge COIN when consecutive relations carry most of the meaning: route arcs, consecutive jobs, neighboring symbols or pair-table transitions.

Absolute locus dominates

Use NB-COIN when item quality depends on where it appears. Use CNB-COIN when sequential left-to-right construction is itself meaningful or should be controlled.

The first locus is special

Use SNE-COIN when the starting item has a separate semantic role but later quality remains transition-driven.

Both position and adjacency matter

Use HNE-COIN to preserve a scattered positional schema, or CNE-COIN to mix Node and Edge decisions continuously through the order.

What each hybrid can preserve—and destroy

A Node anchor can protect an absolute position while splitting a good edge. An Edge completion can protect adjacency while moving an item away from a good locus. HNE-COIN makes that trade-off explicit through a retained-locus mask. CNE-COIN makes it stochastic at every link. An ablation should therefore record template density or Node-source ratio, not just the final algorithm label.

Current naming: “HNE-COIN” means Node template followed by Edge completion. “CNE-COIN” means Node at position 0 followed by an independent Node-or-Edge choice per link. The reusable suite does not present a duplicate Legacy Hybrid as a separate modern variant.

The complete COIN variant family

Single-objectiveStored knowledgeSamplingMulti-objective
Edge COINH[previous,next]edge chainMO Edge COIN
NB-COINW[position,item]random position firstMO NB-COIN
CNB-COINW[position,item]position 0→nMO CNB-COIN
SNE-COINS[start]+H[edge]start then edgeMO SNE-COIN
HNE-COINW+HNode template→Edge fillMO HNE-COIN
CNE-COINW+HNode/Edge per linkMO CNE-COIN

Multi-objective COIN does not change a variant’s representation or sampler. It changes the evidence interface: nondominated rank/Pareto depth and diversity-based selection scores replace scalar fitness sorting, while an external archive retains nondominated solutions.

POPULATIONpermutationsshared evaluator
OBJECTIVESF(x)m-dimensional vectors
RANKINGPareto depthdominance + diversity
EVIDENCEreward / punishselected solution sets
MODELH, W or bothsame variant sampler
EXTERNAL ARCHIVENondominated union across generationsReport convergence, spread and nondominated ratio—not only the number of answers.
+
Multi-objectivization: A scalar fitness may be decomposed into several useful learning signals, but a constant or redundant objective contributes no selection pressure.

From objective vectors to model evidence

For minimization, solution x dominates y when it is no worse in every objective and strictly better in at least one. Nondominated sorting partitions the population into depth 0, depth 1 and deeper fronts. COIN then combines depth with a diversity-aware selection score so that reward evidence is not drawn only from one extreme of the frontier.

  1. Evaluate all candidates with the identical objective functions used by competing algorithms.
  2. Perform nondominated sorting and compute diversity information.
  3. Select reward and punishment evidence from the resulting ranking.
  4. Update the same H, W, S or hybrid model used by the corresponding single-objective variant.
  5. Merge candidates into the external archive and remove dominated or duplicate objective vectors.

Do not report only archive size

IndicatorQuestion answeredDirection
ConvergenceHow close is the algorithm’s set to the observed/reference Pareto set?lower is better
SpreadHow evenly does the set cover the objective trade-off?lower is better for the adopted spread definition
Nondominated ratioWhat fraction of an algorithm’s returned set survives against the union?higher is better
HypervolumeHow much dominated objective space is covered relative to a declared reference point?higher is better
Archive sizeHow many unique nondominated objective vectors were retained?descriptive, not sufficient alone

Every indicator must use a common normalization and a stated reference construction. For three or more objectives, pairwise 2-D projections are explanatory views, not replacements for dominance in the full objective space.

Parameters, complexity and diagnostics

Reward selection (%)

A smaller fraction is more selective but noisier. A larger fraction is steadier but may average evidence from several basins.

Punishment selection (%)

The worse-tail fraction used as negative evidence. It is neither a mutation rate nor a number of tournaments.

Training rate

Controls initial integer-weight scale. A higher rate makes new evidence influential sooner.

Learning mode

Conservative accumulates history; reconstruction responds rapidly to the current reward set.

FamilyMemoryEvidence countPopulation sampling
Edge / NB / CNBΘ(n²)Θ(Pn)Θ(Pn²) with row scans
SNE-COINΘ(n²+n)Θ(Pn)Θ(Pn²)
HybridsΘ(2n²)Θ(Pn)Θ(Pn²)
+
Permutation validity

No item is missing or duplicated.

Weight validity

Edge diagonal remains zero; every legal off-diagonal weight remains positive.

Reproducibility

The same seed and configuration reproduce the same stochastic trace.

Research progress

Record best-so-far per objective, diversity, concentration, Pareto depth, archive size and evaluations-to-solution.

A reproducible comparison protocol

  1. Freeze the problemConstruct one immutable evaluator instance per benchmark and share it across all algorithms.
  2. Equalize budgetsUse the same number of objective evaluations. Report early termination separately when an exact optimum is certified.
  3. Control seedsRun a declared seed set, beginning with seed 1 for a quick demonstration but using multiple seeds for inference.
  4. Preserve raw setsStore permutations, objective vectors, generation/evaluation index, parameter configuration and runtime.
  5. Separate quality and speedReport objective evaluations to target, wall time, evaluator throughput and model overhead independently.
  6. Use statistical summariesPublish median, mean, dispersion, success rate and paired comparisons—not only the most favorable run.

Failure modes visible in the model

Premature concentration

A few cells absorb most row mass, diversity falls and best-so-far stops improving. Reduce selection pressure, lower training rate influence, or use a more conservative update.

Diffuse non-learning

Rows remain almost uniform and the learning curve resembles random sampling. Increase evidence strength, inspect whether the selected sets are genuinely different, and verify objective direction.

Representation mismatch

Fitness improves slowly although weights concentrate strongly. The model may be learning adjacency while the problem rewards position—or vice versa. Compare Edge, Node and hybrid ablations.

Misleading MO progress

One objective improves while another is ignored, or a projected frontier looks strong but is dominated in full dimension. Inspect Pareto depth, full vectors and the external archive.

Recommended learning-progress traces

Plot best-so-far for every objective against objective evaluations. Add archive size and nondominated ratio for MO runs, and optionally matrix entropy or effective row support to expose how fast the model concentrates. A minimization best-so-far curve must be non-increasing; an upward jump is a reporting or sign bug, not learning.

Source map: explanation to reusable library

ComponentPython sourceResponsibility
Edgemodels/edge_reference.py
models/edge_optimized.py
Readable and equivalence-tested optimized implementations
Learninglearning/reward_punishment.pyInteger reward/punishment update kernel
NB / CNBmodels/position.py
models/cnb_position.py
Random-position and chained-position samplers
Composite modelsmodels/start_node_edge.py
models/hybrid.py
models/hybrid_chain.py
Start-aware and Node–Edge hybrids
MO orchestrationcore/multiobjective.pyPareto selection, archive and progress
+

Reusable interface boundary

Each model is responsible for initialization, population generation, and learning from selected permutations. The optimization driver owns evaluation budgets, objective direction, best-so-far records and termination. This separation lets the same COIN model solve Flow Shop, TSPTW, Linear Ordering, Sudoku, RNA candidate ordering, load partitioning and other permutation tasks without embedding domain code in the learner.

model = Variant(config, rng)
algorithm = PermutationCoinAlgorithm(model, problem)
result = algorithm.run(evaluation_budget)

# Multi-objective changes the orchestration:
algorithm = MultiObjectiveCoinAlgorithm(model, problem)
pareto_set = algorithm.run(evaluation_budget)

Tests required before a new variant joins the suite

  • Every generated chromosome is a complete permutation.
  • Reward and punishment counts match a hand-calculated fixture.
  • Forbidden transitions retain zero while legal transitions retain positive support.
  • Seeded sampling is reproducible.
  • Optimized and readable kernels produce equivalent state transitions.
  • The evaluator count equals the declared budget, including the final partial generation.
  • Single-objective best-so-far has the correct monotonic direction.
  • MO archives contain no dominated members or duplicate objective vectors under the declared policy.
Research use

The model snapshot is itself experimental evidence. Exporting H, W, S, template masks and CNE-COIN source masks makes it possible to explain what the algorithm learned—not merely which objective value it returned.

← Negative KnowledgeNext: Multi-objective →