Skip to content

About

Interactive optimization explorer for learning: 58 algorithms from line search, Newton, BFGS, trust regions and SQP to simplex, branch and bound, ant colonies, NSGA-II, Bayesian optimization, topology and truss sizing. Type your own problems, race algorithms, download reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Optimization Explorer

Try the Explorer in your browser

Live: hossbh.github.io/Optimization-Explorer
Runs in your browser. Nothing to install or download.

Six views from the Explorer: a particle swarm on the Rastrigin egg-crate in 2-D and 3-D, a bridge found by topology optimization, NSGA-II tracing a Pareto front, a branch-and-bound tree on integer points, the ten-bar truss sized by SQP, and BFGS following the Rosenbrock valley
Click the picture or the button to open the live Explorer.

An interactive explorer of mathematical optimization, built for learning and experimenting. Pick a problem class, press play and watch an algorithm search, one iteration at a time. Read every update rule with your current settings, check the optimality conditions at the answer, race algorithms against each other, then type in your own objective and constraints and download a report.

It is the companion to the Agent-Based Modeling Explorer and the Cellular Automata Explorer and uses the same layout. The structural classes (truss sizing, topology, constrained engineering design) follow Optimization of Structural and Mechanical Systems (J. S. Arora, ed., 2007).

Ten problem classes, 58 algorithms

Class Algorithms What you see
Line search (1-D) golden section, Fibonacci, bisection on f′, successive parabolic interpolation, Brent, Newton, secant, Armijo backtracking, grid search the shrinking bracket, the fitted parabolas and Newton quadratics, the Armijo line
Unconstrained steepest descent, coordinate descent, momentum, Nesterov, AdaGrad, RMSProp, Adam, nonlinear CG (four β formulas), Newton (three Hessian modifications), BFGS, DFP, L-BFGS, trust region (dogleg, with exact/BFGS/SR1 models), Nelder–Mead, Hooke–Jeeves, random search, (1+1)-ES, simulated annealing, real-coded GA, particle swarm, differential evolution, CMA-ES contour map and 3-D surface with the path, line-search trials, quadratic-model ellipses, trust regions, simplexes, swarms and CMA-ES ellipses
Constrained exterior penalty, log barrier, augmented Lagrangian, SQP, and the metaheuristics with Deb's feasibility rules or a penalty hatched infeasible regions, the penalised subproblem the inner solver really sees, SQP's linearised constraints
Linear programming simplex method (two-phase tableau, Dantzig or Bland), primal–dual interior point, vertex enumeration the feasible polygon (or a 3-D polytope), the live tableau with pivot, shadow prices and the dual problem
Integer programming branch and bound (three node rules), Gomory cutting planes, rounding, enumeration lattice points, branch regions and cuts, the branch-and-bound tree
Travelling salesman nearest neighbour, cheapest insertion, 2-opt, simulated annealing, ant colony system, genetic algorithm (OX), Held–Karp (exact) the tour, 2-opt edge swaps, pheromone trails; click to add cities
Multi-objective NSGA-II, weighted sum, ε-constraint, random sampling design space and objective space side by side, the true front, hypervolume, a compromise design
Bayesian / surrogate Gaussian-process Bayesian optimization (EI, PI, LCB; Matérn or squared-exponential kernel), random search the GP mean and uncertainty band, the acquisition function and the next sample
Topology SIMP with optimality criteria (sensitivity or density filter), BESO material appearing on a finite-element mesh in 2-D and 3-D; paint void or solid regions
Truss sizing fully stressed design, SQP, GA, PSO, DE, CMA-ES member widths by area and colours by stress, the deformed shape; the classic ten-bar truss reaches the best-known 5060.9 lb

The library has 72 ready-made problems: Rosenbrock, Himmelblau, Rastrigin, Branin and other test functions; textbook constrained problems; engineering designs (three-bar truss, cantilever beam, coil spring, welded beam, pressure vessel); the Wyndor product mix and Klee–Minty cube; knapsack; ZDT and Fonseca–Fleming fronts; MBB beam, cantilever, bridge and L-bracket domains; the ten-bar truss and a Pratt bridge.

Your own problems

Every class takes your own input:

  • Expressions: type an objective such as (1 - x)^2 + 100*(y - x^2)^2, constraints such as x^2 + y^2 <= 2, bounds and a start point. Intermediate quantities can be defined (sigma = 6*P*L/(b*h^2)) and used anywhere. Gradients and Hessians are computed exactly by symbolic differentiation (shown in Fig. 3); you can switch to finite differences to see what they cost.
  • Models: write a linear or integer program as text (max 3x + 5y, x + y <= 4, int x, y), paste city coordinates for the TSP, describe a truss as nodes, members, supports and loads, or choose two objectives for a Pareto study.

What you can do

  • Case library: 72 cases across the ten classes, each with a short explanation; 27 of them are guided experiments in the Learn section.
  • Watch and step: play, pause, step one iteration, or run to the end. The map, the 3-D view, the convergence charts and the algorithm panel update live.
  • Read the algorithm: Fig. 3 shows the update rule, the steps with your current parameter values, what happened in this iteration, the exact derivatives, and a full iteration log.
  • Check the answer: at the end, the gradient and Hessian eigenvalues, or for constrained problems the KKT conditions, Lagrange multipliers (shadow prices) and the second-order test on the tangent space; LP results come with reduced costs, shadow prices and the dual.
  • Race lab: race several algorithms from the same start (paths, convergence against evaluations, leaderboard), run multi-start or repeated-seed statistics, sweep a parameter, or map the basins of attraction of a 2-D problem.
  • Report: generate a self-contained HTML report (problem, method and settings, result, optimality check, picture, charts, iteration table, your notes), print it to PDF, or download Markdown, JSON or CSV.
  • Share: Copy link stores the problem, the algorithm, its settings and the seed in the URL. Cases also open directly, e.g. …/Optimization-Explorer/#case=topo-mbb.

Keyboard: Space play or pause · → one iteration · R restart · E run to the end.

Run it locally

The Explorer is a single HTML file with no build step. Download index.html and open it in any modern browser with an internet connection (three.js and the fonts load from CDNs).

How it works

  • Every algorithm is a JavaScript generator: one yield is one iteration and carries what the views need (the point, the population, the simplex, the trust region, the tableau, the tree…). The same code drives the animation, the race lab and the report.
  • Your expressions are parsed into syntax trees, simplified, differentiated symbolically and compiled to JavaScript, so a function evaluation costs about as much as hand-written code.
  • Line searches implement the Armijo and strong Wolfe conditions (Nocedal and Wright, Algorithms 3.5–3.6). SQP solves its quadratic subproblems by dual coordinate ascent followed by an exact active-set refinement, with Powell-damped BFGS, an exact-penalty merit function and Powell's relaxation when the linearised constraints are inconsistent.
  • The topology class assembles bilinear plane-stress elements and solves with a banded Cholesky factorisation, so a 90 × 30 mesh takes a few tens of milliseconds per iteration.
  • Random numbers are seeded, so the same seed and settings always give the same run.
  • Light and dark themes follow the system setting or the toggle in the top bar.

Further reading

  • J. S. Arora (ed.), Optimization of Structural and Mechanical Systems. World Scientific, 2007.
  • J. S. Arora, Introduction to Optimum Design, 4th ed. Academic Press, 2017.
  • J. Nocedal and S. J. Wright, Numerical Optimization, 2nd ed. Springer, 2006.
  • S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge University Press, 2004.
  • R. T. Haftka and Z. Gürdal, Elements of Structural Optimization, 3rd ed. Kluwer, 1992.
  • G. B. Dantzig, Linear Programming and Extensions. Princeton University Press, 1963.
  • N. Hansen, “The CMA evolution strategy: a tutorial”, arXiv:1604.00772, 2016.
  • K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, “A fast and elitist multiobjective genetic algorithm: NSGA-II”, IEEE Trans. Evol. Comp. 6, 182–197, 2002.
  • D. R. Jones, M. Schonlau and W. J. Welch, “Efficient global optimization of expensive black-box functions”, J. Global Optimization 13, 455–492, 1998.
  • M. P. Bendsøe and O. Sigmund, Topology Optimization: Theory, Methods and Applications. Springer, 2003.
  • E. Andreassen et al., “Efficient topology optimization in MATLAB using 88 lines of code”, Struct. Multidisc. Optim. 43, 1–16, 2011.
  • M. Dorigo and L. M. Gambardella, “Ant colony system”, IEEE Trans. Evol. Comp. 1, 53–66, 1997.

The full list of 40 references is in the Learn section of the Explorer.

Credits

3-D rendering by three.js (MIT licence). Fonts: Archivo and STIX Two Text from Google Fonts. The algorithms are independent implementations of the published methods cited above.

© 2026 Hossein Basereh. All rights reserved.

About

Interactive optimization explorer for learning: 58 algorithms from line search, Newton, BFGS, trust regions and SQP to simplex, branch and bound, ant colonies, NSGA-II, Bayesian optimization, topology and truss sizing. Type your own problems, race algorithms, download reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages