
Заключение
В ходе проделанной работы оптимальное решение задачи получено не было, т. е. можно сделать вывод о том, что седловая точка функции Лагранжа отсутствует. В связи с этим можно сделать следующие выводы и рекомендации.
Применить для решения задачи поисковые методы оптимизации.
Рассмотреть квадратичную задачу о назначениях.
Переопределить матрицы А и В, дополнив их смысловую нагрузку.
Недостатком используемого метода является большое количество переменных даже при небольшой размерности задачи.
Список использованных источников
Зайченко Ю. П. Исследование операций: Учеб. пособие. - Киев: "Вища школа", 1975, 320с.: ил.
Дегрярев Ю. И. Исследование операций: Учеб. для вузов по спец. АСУ. - М.: Высш. шк., 1986. - 320 с.: ил.
Электронный учебник "Теория принятия решений".
Приложение а
unit Unit2;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, Grids;
type TForm2 = class(TForm)
Button2: TButton;
Button3: TButton;
ed_m: TEdit;
ed_n: TEdit;
Label2: TLabel;
Label3: TLabel;
Button5: TButton;
Button6: TButton;
BitBtn1: TBitBtn;
SGr: TStringGrid;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
b, nb : byte;
C, Ci, ish : array [1..30,1..30] of real;
i, j, m, n : byte;
max, min, v : real;
str : string;
implementation
uses Unit1; {$R *.DFM}
procedure TForm2.Button2Click(Sender: TObject);
begin for i:=1 to 12 do
for j:=1 to 12 do begin
c[i,j]:=StrToFloat(SGr.Cells[i,j]);
ci[i,j]:=StrToFloat(SGr.Cells[i,j]);
ish[i,j]:=StrToFloat(SGr.Cells[i,j]);
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
max:=0;
for i:=2 to 12 do
begin
if (C[i,1]>0) then if (C[i,1]>max) then begin max:=C[i,1]; m:=i;end;
end;
min:=10;
for j:=2 to 12 do
begin
if (c[m,j]>0) then if (c[1,j]/c[m,j]<min)then
begin min:=c[1,j]/c[m,j]; n:=j; v:=c[m,n];end;
end;
for i:=1 to 12 do begin c[i,n] := c[i,n]/v; SGr.Cells[i,n]:=FloatToStr(c[i,n]); end;
for j:=1 to 12 do begin c[m,j] := - c[m,j]/v; SGr.Cells[m,j]:=FloatToStr(c[m,j]); end;
c[m,n] := 1/v; SGr.Cells[m,n]:=FloatToStr(c[m,n]);
str:=SGr.Cells[m,0];
SGr.Cells[m,0] :=SGr.Cells[0,n];
SGr.Cells[0,n]:=str;
for i:=1 to m-1 do
for j:=1 to n-1 do
begin
c[i,j]:=c[i,j]-(ci[m,j]*ci[i,n])/v;
SGr.Cells[i,j]:=FloatToStr(c[i,j]);
end;
for i:=1 to m-1 do
for j:=n+1 to 12 do
begin
c[i,j]:=c[i,j]-(ci[m,j]*ci[i,n])/v;
SGr.Cells[i,j]:=FloatToStr(c[i,j]);
end;
for i:=m+1 to 12 do
for j:=1 to n-1 do
begin
c[i,j]:=c[i,j]-(ci[m,j]*ci[i,n])/v;
SGr.Cells[i,j]:=FloatToStr(c[i,j]);
end;
for i:=m+1 to 12 do
for j:=n+1 to 12 do
begin
c[i,j]:=c[i,j]-(ci[m,j]*ci[i,n])/v;
SGr.Cells[i,j]:=FloatToStr(c[i,j]);
end;
for i:=1 to 12 do
for j:=1 to 12 do
ci[i,j]:=c[i,j];
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
m:=StrToInt(ed_m.text);
n:=StrToInt(ed_n.text);
v:=StrToFloat(SGr.Cells[m,n]);
Button3Click(Form2);
end;
procedure TForm2.Button6Click(Sender: TObject);
begin
for i:=1 to 12 do
for j:=1 to 12 do SGr.Cells[i,j]:=FloatToStr(ish[i,j]);
SGR.Cells[1,0]:='B';
SGR.Cells[2,0]:='x1';
SGR.Cells[3,0]:='x2';
SGR.Cells[4,0]:='x3';
SGR.Cells[5,0]:='x4';
SGR.Cells[6,0]:='x5';
SGR.Cells[7,0]:='x6';
SGR.Cells[8,0]:='k1';
SGR.Cells[9,0]:='k2';
SGR.Cells[10,0]:='k3';
SGR.Cells[11,0]:='k4';
SGR.Cells[12,0]:='k5';
SGR.Cells[0,1]:='W';
SGR.Cells[0,2]:='v1';
SGR.Cells[0,3]:='v2';
SGR.Cells[0,4]:='v3';
SGR.Cells[0,5]:='t1';
SGR.Cells[0,6]:='t2';
SGR.Cells[0,7]:='u1';
SGR.Cells[0,8]:='u2';
SGR.Cells[0,9]:='u3';
SGR.Cells[0,10]:='u4';
SGR.Cells[0,11]:='u5';
SGR.Cells[0,12]:='u6';
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
form2.close;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
SGR.Cells[1,0]:='B';
SGR.Cells[2,0]:='x1';
SGR.Cells[3,0]:='x2';
SGR.Cells[4,0]:='x3';
SGR.Cells[5,0]:='x4';
SGR.Cells[6,0]:='x5';
SGR.Cells[7,0]:='x6';
SGR.Cells[8,0]:='k1';
SGR.Cells[9,0]:='k2';
SGR.Cells[10,0]:='k3';
SGR.Cells[11,0]:='k4';
SGR.Cells[12,0]:='k5';
SGR.Cells[0,1]:='W';
SGR.Cells[0,2]:='v1';
SGR.Cells[0,3]:='v2';
SGR.Cells[0,4]:='v3';
SGR.Cells[0,5]:='t1';
SGR.Cells[0,6]:='t2';
SGR.Cells[0,7]:='u1';
SGR.Cells[0,8]:='u2';
SGR.Cells[0,9]:='u3';
SGR.Cells[0,10]:='u4';
SGR.Cells[0,11]:='u5';
SGR.Cells[0,12]:='u6';
end;
end.