--- id: directsearch version: "1.1" license: GPL-3.0-or-later license_treatment: copyleft maintenance: active --- # directsearch — A derivative-free solver for unconstrained minimization License: copyleft · Maintenance: active · Downloads: 437.6K/mo ## What it is and what it does directsearch is a Python package implementing direct search methods for derivative-free optimization. It solves minimization problems where you have an objective function but cannot or do not want to compute its gradient—useful when function evaluations are expensive, noisy, or unavailable analytically. The package supports both unconstrained problems and problems with linear inequality constraints (including bounds). It depends on numpy and scipy for numerical operations. The core interface is a single `solve()` function that takes your objective, a starting point, and optional constraint matrices, returning the approximate minimizer, its value, the number of function evaluations used, and a termination flag. The package also exposes specialized solvers: deterministic direct search, probabilistic descent variants, subspace methods for higher dimensions, and the stochastic three-points method. Configuration options include maximum evaluations, verbosity, and print frequency. Use it for: - Optimize expensive simulations or physical experiments where gradient computation is infeasible or prohibitively costly. - Tune hyperparameters or model coefficients when the objective is noisy or only available through sampling. - Solve bound-constrained or linearly constrained problems without implementing custom constraint handling. - Benchmark derivative-free methods on small to moderate-dimensional problems (roughly under 50 variables). - Replace gradient-based optimizers when the objective is non-smooth or discontinuous in practice. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Solves unconstrained and linearly constrained nonlinear minimization problems without computing derivatives, using direct search methods that work well when objective function evaluations are expensive or noisy. Yes, if you need derivative-free optimization for expensive or noisy objectives and accept the GPL-3.0-or-later copyleft license. The package is actively maintained, has no known vulnerabilities, and installs with low friction. It is well-suited for unconstrained problems and problems with linear constraints up to moderate dimension; for very high-dimensional problems, verify that the subspace method meets your scalability needs. ## Install pip install directsearch uv add directsearch poetry add directsearch ## Installing directsearch Before you install: Low friction install with three standard scientific dependencies (setuptools, numpy, scipy). Actively maintained with a recent release and no known vulnerabilities. License in practice: Released under GPL-3.0-or-later (copyleft). You may use and modify the package freely, but any derivative work or distribution must also be released under a compatible GPL license. Quickstart: pip install directsearch import directsearch import numpy as np def objective(x): return (x[0] - 2)**2 + (x[1] + 1)**2 x0 = np.array([0.0, 0.0]) soln = directsearch.solve(objective, x0) print(soln.x, soln.f, soln.nf) Requires Python 3.9 or later; objective function must accept and return numpy arrays and floats respectively. Verify before relying: - Scalability limits for high-dimensional problems beyond the mentioned rule-of-thumb threshold of ~50 dimensions. - Actual convergence rates and wall-clock performance compared to other derivative-free solvers on standard benchmarks. - How constraint handling in v1.1 affects solution quality and iteration count for typical constrained problems. ## Package facts - License: GPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 437.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags derivative-free optimization, direct search minimization, black-box optimization, gradient-free solver, expensive function optimization, noisy objective minimization, unconstrained nonlinear optimization, optimization, derivative-free, direct-search [View on SkillFed](https://skillfed.io/packages/directsearch) · [View on PyPI](https://pypi.org/project/directsearch/)