Skip to content

Commit e95843e

Browse files
committed
Fix latex for bilevel_introduction notebook
1 parent fd60e00 commit e95843e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

authors/eduardosalaz/bilevel/bilevel_introduction.ipynb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"metadata": {},
5+
"metadata": {
6+
"id": "9_qd3IFVeXZB"
7+
},
68
"source": [
79
"# Bilevel Optimization Introduction\n",
810
"[![bilevel_introduction.ipynb](https://img.shields.io/badge/github-%23121011.svg?logo=github)](https://github.com/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Open In Deepnote](https://deepnote.com/buttons/launch-in-deepnote-small.svg)](https://deepnote.com/launch?url=https://github.com/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Open In Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://github.com/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Open In Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://console.paperspace.com/github/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Open In SageMaker Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb) [![Powered by AMPL](https://h.ampl.com/https://github.com/ampl/colab.ampl.com/blob/master/authors/eduardosalaz/bilevel/bilevel_introduction.ipynb)](https://ampl.com)\n",
@@ -22,7 +24,9 @@
2224
{
2325
"cell_type": "code",
2426
"execution_count": 1,
25-
"metadata": {},
27+
"metadata": {
28+
"id": "r8Q6q4B_eXZE"
29+
},
2630
"outputs": [],
2731
"source": [
2832
"# Install dependencies\n",
@@ -32,7 +36,9 @@
3236
{
3337
"cell_type": "code",
3438
"execution_count": 2,
35-
"metadata": {},
39+
"metadata": {
40+
"id": "zEw9OOW7eXZE"
41+
},
3642
"outputs": [],
3743
"source": [
3844
"# Google Colab & Kaggle integration\n",
@@ -69,7 +75,8 @@
6975
"& y^* \\in \\arg\\min_{y} \\{f(x,y) : g(x,y) \\leq 0\\} && \\text{(Follower's problem)}\n",
7076
"\\end{align}\n",
7177
"$\n",
72-
"**​Key point**: The leader's objective depends on $y*$, which is the optimal solution to the follower's problem (which itself depends on $x$).\n",
78+
"\n",
79+
"**Key point**: The leader's objective depends on $y*$, which is the optimal solution to the follower's problem (which itself depends on $x$).\n",
7380
"\n",
7481
"## Why \"Bilevel\"?\n",
7582
"\n",
@@ -410,6 +417,7 @@
410417
"### Why Complementarity Represents \"Either/Or\" Logic\n",
411418
"\n",
412419
"The lower level problem is:\n",
420+
"\n",
413421
"$$\n",
414422
"\\min_{y} \\quad (y - x)^2 \\quad \\text{s.t.} \\quad y \\geq 0\n",
415423
"$$\n",
@@ -459,11 +467,13 @@
459467
"#### **Case 2: Boundary Solution ($y = 0$, so $\\lambda > 0$)**\n",
460468
"\n",
461469
"If $y = 0$, from stationarity:\n",
470+
"\n",
462471
"$$2(0 - x) - \\lambda = 0 \\implies \\lambda = -2x$$\n",
463472
"\n",
464473
"For dual feasibility, we need $\\lambda \\geq 0$, which requires $x \\leq 0$.\n",
465474
"\n",
466475
"Substituting $y = 0$ into the upper level:\n",
476+
"\n",
467477
"$$\\min_{x \\leq 0} \\quad x^2 + (0 - 10)^2 = x^2 + 100$$\n",
468478
"\n",
469479
"This is minimized at $x = 0$ (closest feasible point to unconstrained minimum).\n",

0 commit comments

Comments
 (0)