AI Glossary / Mathematics and optimization / Advanced

Convex set

Definition

A convex set contains the entire straight line segment joining any two of its points. Formally, if x and y belong to a set C, then tx + (1 − t)y must also belong to C for every t between zero and one. These weighted averages are convex combinations. The definition applies in higher-dimensional spaces as well as to familiar shapes on a page.

What it means

If a set represents feasible continuous plans, convexity says that blending two feasible plans remains feasible. This is a property of the allowed decisions, not a statement about which decision is best. An objective function is needed to compare their costs or benefits.
The interpretation depends on what the variables mean. Averaging two divisible material allocations can describe a valid third allocation. Averaging two yes/no equipment selections can produce fractional selections that have no operational meaning. Check the actual decision domain.

How it works

To prove convexity directly, take arbitrary points in the set and show that every convex combination satisfies its defining conditions. Another approach builds the set from known convex sets using operations that preserve convexity. Intersections preserve it, so imposing several convex restrictions together leaves a convex feasible set, possibly empty.
Affine transformations also preserve convexity. Unions do not preserve it in general. A line segment, halfspace, filled Euclidean ball and polyhedron are standard examples. A circle's circumference alone is not convex, even though the filled disk it bounds is. The condition includes every point along each segment.

Three practical examples

  • A resource planner imposes nonnegative allocations and linear capacity limits. Any weighted average of two feasible continuous allocations satisfies the same limits. This makes blending plans possible without immediately violating those modeled restrictions.
  • A prediction system outputs probability vectors. Nonnegative coordinates summing to one form a convex set, so averaging two valid probability vectors produces another valid probability vector. This says nothing by itself about the averaged prediction's accuracy.
  • A designer limits the Euclidean magnitude of a parameter vector. The allowed vectors form a filled ball, which is convex. Requiring exactly that magnitude instead produces a sphere, generally excluding the points between different allowed vectors.

Think of it this way

Think of stretching a thread between two allowed locations. The set is convex only if every such thread stays entirely within the allowed region. If even one pair forces the thread through a forbidden gap, the set fails the test. Checking a few convenient pairs can illustrate the idea but cannot establish the property in general.

Worked example

Consider an allocation set C defined by x ≥ 0, y ≥ 0 and x + 2y ≤ 8. The coordinates represent amounts of two resources, with the second consuming twice as much capacity per unit.
Two feasible plans are a = (2, 3) and b = (6, 1). Both consume eight capacity units. Their equal blend is (4, 2), which also consumes eight. A blend with weight one-quarter on a and three-quarters on b gives (5, 1.5), again consuming eight. Fractional quantities are allowed in this example.
To prove the full set convex, take any feasible a and b and define z = ta + (1 − t)b for 0 ≤ t ≤ 1. Both coordinates of z are nonnegative because its weights and the original coordinates are nonnegative. Also, z₁ + 2z₂ = t(a₁ + 2a₂) + (1 − t)(b₁ + 2b₂) ≤ t × 8 + (1 − t) × 8 = 8. Thus every required blend is feasible, not just the two numerical examples.
Now restrict the variables to whole numbers. The feasible plans (1, 0) and (0, 1) have midpoint (0.5, 0.5), which violates that requirement. The integer-restricted set is not convex.

Illustrative case study

In a fictional production team, two operating modes satisfy different limits. Mode A permits allocations in a small region near (0, 0), while mode B permits allocations near (4, 0). The team treats the choice of either mode as the union of those regions.
An analyst assumes that because each mode's region is convex, their union must be convex too. A simple one-dimensional version exposes the error: allowed settings [0, 1] or [3, 4] include zero and four but exclude their midpoint two. A blended recommendation can fall between the operating modes and be unusable.
The team records the mode selection explicitly instead of silently filling the gap. Replacing the union with its convex hull would allow additional settings and constitute a relaxation. It might help produce a bound or an exploratory comparison, but its answer would still require checking against the original mode restrictions.

Common misconceptions and mistakes

Convex does not mean closed, bounded or full-dimensional. An open interval is convex, an unbounded halfspace is convex, and a line segment in a plane is convex. The empty set and single-point sets are also convex under the definition.
A convex set alone does not guarantee easy optimization for any objective placed on it. Likewise, a union of convex sets may be nonconvex, while their intersection remains convex. Finally, distinguishing a filled region from its boundary is essential: opposite points on a circle have a midpoint inside the disk but outside the circumference.

Business use

Convexity helps analysts identify when interpolating plans preserves modeled feasibility and when optimization tools can exploit favorable geometry. Explain whether quantities are genuinely divisible and whether logical choices or operating modes introduce gaps. Preserve those requirements in the model. A fractional or blended answer should not be approved merely because it satisfies a relaxed capacity calculation while violating the original operating rules.

People also ask

Must a convex set have a curved boundary?

No. Rectangles, polyhedra and line segments provide counterexamples.

Can adding constraints preserve convexity?

Yes, when it amounts to intersecting convex sets, although the intersection can be empty.

Is every average of feasible discrete plans feasible?

No. The integer-allocation example shows the problem with fractional averages.

Check your understanding

Why is (4, 2) feasible in the worked example?

Answer: Both coordinates are nonnegative and 4 + 2 × 2 = 8.

What disproves convexity of [0, 1] union [3, 4]?

Answer: The midpoint of zero and four is excluded.

Why is the circumference of a circle not convex?

Answer: A connecting segment between opposite points passes through points off the circumference.

Related terms

  • Convex hull
  • Probability simplex
  • Convex function
  • Convex combination
  • feasible region
  • halfspace
  • polyhedron
  • relaxation

Learn next

Practice proving convexity from defining inequalities. Then study convex hulls and how continuous relaxations can provide useful bounds while introducing decisions that the original discrete problem does not allow.

More in Mathematics and optimization

  • Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
  • Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
  • Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
  • Σ-algebra
  • Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
  • Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.

Sources

AIMA glossary, convex set: the line-segment definition and relationship to feasible regions. https://github.com/aimacode/aima-glossary/blob/master/glossary.md Stephen Boyd and Lieven Vandenberghe, Convex Optimization slides, chapter 2: convex combinations, standard sets, intersections and affine mappings. https://web.stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf The allocation proof and fictional operating-mode case are original teaching illustrations.

Previous: Convex optimization problem Next: Convolution

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer