ArticleslgStudy

computer science

Consensus based optimization

Consensus based optimization is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Consensus based optimization rather than just read about it. In short: Consensus-based optimization (CBO) is a multi-agent derivative-free optimization method, designed to obtain solutions for global optimization problems of the form minx∈𝒳f(x), where f:𝒳→ℝ denotes the objective function acting on the state space 𝒳, which is assumed to be a normed vector space. The function f can potentially be nonconvex and nonsmooth.

Consensus based optimization — main illustration
Consensus based optimization — illustration

Key takeaways

  • Consensus based optimization belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Consensus based optimization to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Consensus based optimization from memory before moving on to harder problems.

Reference excerpt

Consensus-based optimization (CBO) is a multi-agent derivative-free optimization method, designed to obtain solutions for global optimization problems of the form minx∈𝒳f(x),

where f:𝒳→ℝ denotes the objective function acting on the state space 𝒳, which is assumed to be a normed vector space. The function f can potentially be nonconvex and nonsmooth. The algorithm employs particles or agents to explore the state space, which communicate with each other to update their positions. Their dynamics follows the paradigm of metaheuristics, which blend exploration with exploitation. In this sense, CBO is comparable to ant colony optimization, wind driven optimization, particle swarm optimization or Simulated annealing.

Algorithm Consider an ensemble of points xt=(xt1,…,xtN)∈𝒳N, dependent of the time t∈[0,∞). Then the update for the ith particle is formulated as a stochastic differential equation, dxti=−λ(xti−cα(xt))dt⏟consensus drift+σD(xti−cα(xt))dBti⏟scaled diffusion, with the following components:

The consensus point cα(x): The key idea of CBO is that in each step the particles “agree” on a common consensus point, by computing an average of their positions, weighted by their current objective function value cα(xt)=1∑i=1Nωα(xti)∑i=1Nxti ωα(xti), with ωα(⋅)=exp(−αf(⋅)).This point is then used in the drift term xti−cα(xt), which moves each particle into the direction of the consensus point. Scaled noise: For each t≥0 and i=1,…,N, we denote by Bti independent standard Brownian motions. The function D:𝒳→ℝs incorporates the drift of the ith particle and determines the noise model. The most common choices are: Isotropic noise, D(⋅)=‖⋅‖: In this case s=1 and every component of the noise vector is scaled equally. This was used in the original version of the algorithm. Anisotropic noise, D(⋅)=|⋅|: In the special case, where 𝒳⊂ℝd, this means that s=d and D applies the absolute value function component-wise. Here, every component of the noise vector is scaled, dependent on the corresponding entry of the drift vector. Hyperparameters: The parameter σ≥0 scales the influence of the noise term. The parameter α≥0 determines the separation effect of the particles: in the limit α→0 every particle is assigned the same weight and the consensus point is a regular mean. In the limit α→∞ the consensus point corresponds to the particle with the best objective value, completely ignoring the position of other points in the ensemble.

Convergence An attractive property of CBO is that it allows for mathematical guarantees, especially through its mean-field interpretation. Global convergence of the numerical method can be established.

Implementation notes In practice, the SDE is discretized via the Euler–Maruyama method such that the following explicit update formula for the ensemble x=(x1,…,xN) is obtained,xi←xi−λ(xi−cα(x))dt+σD(xi−cα(x))Bi.If one can employ an efficient implementation of the LogSumExp functions, this can be beneficial for numerical stability of the consensus point computation. We refer to existing implementation in Python [1] and Julia [2].

Variants

Sampling Consensus-based optimization can be transformed into a sampling method by modifying the noise term and choosing appropriate hyperparameters. Namely, one considers the following SDE dxti=−(xti−cα(xt))dt+2λ~−1Cα(xt)dBti, where the weighted covariance matrix is defined as Cα(xt):=1∑i=1Nωα(xti)∑i=1N(xti−c(xt))⊗(xti−c(xt))ω(xti). If the parameters are chosen such that λ~−1=(1+α) the above scheme creates approximate samples of a probability distribution with a density, that is proportional to exp⁡(−αf).

Polarization If the function f is multi-modal, i.e., has more than one global minimum, the standard CBO algorithm can only find one of these points. However, one can “polarize” the consensus computation by introducing a kernel k:𝒳×𝒳→[0,∞) that includes local information into the weighting. In this case, every particle has its own version of the consensus point, which is computed ascαj(x)=1∑i=1Nωαj(xi)∑i=1Nxi ωαj(xi), with ωαj(⋅)=exp(−αf(⋅))k(⋅,xj).In this case, the drift is a vector field over the state space 𝒳. Intuitively, particles are now not only attracted to other particles based on their objective value, but also based on their spatial locality. For a constant kernel function, the polarized version corresponds to standard CBO and is therefore a generalization. We briefly give some examples of common configurations:

Gaussian kernel k(⋅,⋅)=exp⁡(−12κ2α‖⋅−⋅‖22): the parameter κ determines the communication radius of particles. This choice corresponds to a local convex regularization of the objective function f. Mean-shift algorithm: Employing polarized CBO for a constant objective function f, together with no noise (i.e. σ=0) and an Euler–Maruyama discretization with step size dt=1, corresponds to the mean-shift algorithm. Bounded confidence model: When choosing a constant objective function, no noise model, but also the special kernel function k(x,x~)=1‖x−x~‖≤κ, the SDE in transforms to a ODE known as the bounded confidence model, which arises in opinion dynamics. A further modification is to also scale the kernel with the objective function, which leads to a provably globally convergent scheme.

See also Particle Swarm Optimization Simulated annealing Ant colony optimization algorithms

References

Illustrations

Consensus based optimization: Behavior of CBO on the Rastrigin function. Blue: Particles, Pink: drift vectors and consensus point.
Behavior of CBO on the Rastrigin function. Blue: Particles, Pink: drift vectors and consensus point.

Worked examples

Example 1 — a first encounter with Consensus based optimization

Start with the simplest possible case. Write down what Consensus based optimization claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Consensus based optimization before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Consensus based optimization ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Consensus based optimization

In research
Consensus based optimization appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Consensus based optimization in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Consensus based optimization is common in secondary-school and first-year university syllabi. It links to neighbouring topics Metaheuristics, Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Consensus based optimization outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Consensus based optimization” →

How to study Consensus based optimization in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Consensus based optimization means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Consensus based optimization out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Consensus based optimization in simple terms?

Consensus-based optimization (CBO) is a multi-agent derivative-free optimization method, designed to obtain solutions for global optimization problems of the form minx∈𝒳f(x), where f:𝒳→ℝ denotes the objective function acting on the state space 𝒳, which is assumed to be a normed vector space. The…

Why does Consensus based optimization matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Consensus based optimization?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Consensus based optimization.

Tags

  • Metaheuristics
  • Optimization algorithms and methods

Keep exploring