De Wikilibros, la colección de libros de texto de contenido libre.
Primero pasamos a la forma que requiere el algoritmo:
Min
f
(
x
_
)
=
(
x
1
−
4
)
2
+
(
x
2
+
1
)
2
+
0
x
3
+
0
x
4
{\displaystyle f({\underline {x}})=(x_{1}-4)^{2}+(x_{2}+1)^{2}+0x_{3}+0x_{4}}
s.a:
x
1
+
x
2
+
x
3
=
3
{\displaystyle x_{1}+x_{2}+x_{3}=3}
x
2
+
x
4
=
2
{\displaystyle x_{2}+x_{4}=2}
x
1
,
x
2
,
x
3
,
x
4
≥
0
{\displaystyle x_{1},x_{2},x_{3},x_{4}\geq 0}
Queda la matriz
A
_
_
{\displaystyle {\underline {\underline {A}}}}
de la forma:
A
_
_
=
[
1
1
1
0
0
1
0
1
]
{\displaystyle {\underline {\underline {A}}}=\left[\ {\begin{matrix}1&1&1&0\\0&1&0&1\end{matrix}}\right]\ }
Además,
∇
f
(
x
_
)
=
(
2
(
x
1
−
4
)
2
(
x
2
+
1
)
0
0
)
{\displaystyle \nabla f({\underline {x}})=\left(\ {\begin{matrix}2(x_{1}-4)\\2(x_{2}+1)\\0\\0\end{matrix}}\right)\ }
Despejando en las restricciones podemos obtener los valores de las variables dependientes:
x
1
+
x
2
+
x
3
=
3
{\displaystyle x_{1}+x_{2}+x_{3}=3}
0
+
2
+
x
3
=
3
{\displaystyle 0+2+x_{3}=3}
x
3
=
1
{\displaystyle x_{3}=1}
x
2
+
x
4
=
2
{\displaystyle x_{2}+x_{4}=2}
2
+
x
4
=
2
{\displaystyle 2+x_{4}=2}
x
4
=
0
{\displaystyle x_{4}=0}
De manera que el punto inicial para el problema así planteado queda:
x
_
(
0
)
=
(
0
2
1
0
)
{\displaystyle {\underline {x}}^{(0)}=\left(\ {\begin{matrix}0\\2\\1\\0\end{matrix}}\right)\ }
Podemos entonces seccionar
A
_
_
{\displaystyle {\underline {\underline {A}}}}
y
x
_
(
0
)
{\displaystyle {\underline {x}}^{(0)}}
en básicos y no básicos, tomando como no básicos los componentes iguales a cero en el punto (los básicos deben corresponder a m columnas l.i. cuyos valores sean mayores que cero -se toman los más positivos):
x
_
B
(
0
)
=
(
x
2
x
3
)
=
(
2
1
)
{\displaystyle {\underline {x}}_{B}^{(0)}=\left(\ {\begin{matrix}x_{2}\\x_{3}\end{matrix}}\right)\ =\left(\ {\begin{matrix}2\\1\end{matrix}}\right)\ }
x
_
N
(
0
)
=
(
x
1
x
4
)
=
(
0
0
)
{\displaystyle {\underline {x}}_{N}^{(0)}=\left(\ {\begin{matrix}x_{1}\\x_{4}\end{matrix}}\right)\ =\left(\ {\begin{matrix}0\\0\end{matrix}}\right)\ }
B
_
_
=
[
1
1
1
0
]
{\displaystyle {\underline {\underline {B}}}=\left[\ {\begin{matrix}1&1\\1&0\end{matrix}}\right]\ }
N
_
_
=
[
1
0
0
1
]
{\displaystyle {\underline {\underline {N}}}=\left[\ {\begin{matrix}1&0\\0&1\end{matrix}}\right]\ }
Calculando la inversa:
B
−
1
_
_
=
[
0
1
1
−
1
]
{\displaystyle {\underline {\underline {B^{-1}}}}=\left[\ {\begin{matrix}0&1\\1&-1\end{matrix}}\right]\ }
Se obtiene a continuación la componente básica y la no básica del gradiente:
∇
N
f
(
x
_
(
0
)
)
=
(
2
(
x
1
−
4
)
0
)
=
(
−
8
0
)
{\displaystyle \nabla _{N}f({\underline {x}}^{(0)})=\left(\ {\begin{matrix}2(x_{1}-4)\\0\end{matrix}}\right)\ =\left(\ {\begin{matrix}-8\\0\end{matrix}}\right)\ }
∇
B
f
(
x
_
(
0
)
)
=
(
2
(
x
2
+
1
)
0
)
=
(
6
0
)
{\displaystyle \nabla _{B}f({\underline {x}}^{(0)})=\left(\ {\begin{matrix}2(x_{2}+1)\\0\end{matrix}}\right)\ =\left(\ {\begin{matrix}6\\0\end{matrix}}\right)\ }