liveBook · Manning

Unconstrained optimization problem

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

An optimization problem with no explicit constraints restricting its decision variables.

An unconstrained optimization problem seeks the best value of an objective without explicit equality or inequality constraints on its decision variables, apart from boundary limits. It is one category within the broader classification of search and optimization problems. section 2.1.3 section 2.5

Ticket pricing

A ticket-pricing model chooses a price between $0 and $250 to maximize profit. SciPy’s bounded scalar solver finds an optimal price of $155 and a profit of $130.50K. Because the solver minimizes, the profit function is negated and the reported result is converted back to profit. section 2.1.3

Listing 2.4 Optimal ticket pricing
import numpy as np
import scipy.optimize as opt
import matplotlib.pyplot as plt
  
def f(x):                                                      #1
    return -(-20*x**2+6200*x-350000)/1000 
 
res=opt.minimize_scalar(f, method='bounded', bounds=[0, 250])  #2
  
print("Optimal Ticket Price ($): %.2f" % res.x)
print("Profit f(x) in K$: %.2f" % -res.fun)

The listing provides a compact implementation of bounded univariate unconstrained optimization with SciPy. section 2.1.3

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines the constraint distinction and demonstrates a bounded solver, but defers constrained solution methods to a separate ticket-pricing variant.
Examples
Uses bounded ticket pricing, a negated profit objective, and a SciPy numerical result as its concrete example.
What it assumes
Assumes familiarity with objective functions and decision variables while distinguishing hard, soft, equality, and inequality constraints.
What you can do after
Apply it via SciPy to formulate and solve a bounded univariate objective, including maximum-to-minimum conversion.
How it connects
Relates unconstrained optimization to objective functions, minimization, constrained optimization, equality constraints, and derivative-based solvers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.