A problem with Linear Programming Problems

Hi everyone, I need a guidance on a problem with linprog. I have an optimization problem that weights and the minimum value of the objective function are needed, but I can't allocate the parameters properly. The form of problem and subjects are like this. The picture of the problem is attached.
Any help regarding understanding the problem and getting a solution would be much appreciated.
P.S.: The object here is to code BWM(Best Worst Method) By Dr. Jafar Rezaei in matlab.
Ws and Ksi are the optimal weights and objective function we want to obtain and As are the vector that its values are present.

3 件のコメント

Torsten
Torsten 2018 年 8 月 24 日
In the first constraint, w_j appears in the denominator. Thus it seems your problem is not linear. Or is it simply an error in notation ?
Mostafa Eftekhary Mamaghani
Mostafa Eftekhary Mamaghani 2018 年 8 月 24 日
Yes, you are right, I forgot to include the other form, you can change the form of the formula.
Torsten
Torsten 2018 年 8 月 24 日
編集済み: Torsten 2018 年 8 月 24 日
You forgot to multiply Xi_L with w_j in the first inequality. This makes the problem nonlinear since Xi_L itself is a solution variable.

サインインしてコメントする。

回答 (3 件)

Ali Naeemah
Ali Naeemah 2021 年 10 月 14 日

1 投票

Please kindly gentlemen, can you highlight the parts that can be changed with my values, please because I am confused about what values I have to change exactly.

1 件のコメント

Ali Naeemah
Ali Naeemah 2021 年 10 月 15 日
Hello sir
Please kindly,
Can you highlight or identify the place that I have to insert my values, please? I am confused about where I have to insert my values exactly in the code.
Thank you so much

サインインしてコメントする。

Matt J
Matt J 2018 年 8 月 24 日

0 投票

It should be straightforward to cast this into the form of linear in/equalities, once you recognize that
|P|<=q
is equivalent to the simultaneous constraints
p-q<=0
-p-q<=0
Mostafa Eftekhary Mamaghani
Mostafa Eftekhary Mamaghani 2018 年 8 月 28 日
編集済み: Mostafa Eftekhary Mamaghani 2018 年 8 月 28 日

0 投票

Here is the code to BMW(Best-Worst Method) in matlab.
clc;clear;close all;
delete Data.mat
DATA = xlsread("Data.xlsx");
NumOfExperts = size(DATA , 1) / 2;
NumOfCriteria = size(DATA , 2);
BestData = DATA( 1:NumOfExperts , : );
WorstData = DATA( NumOfExperts + 1: end , :);
WorstData = WorstData';
ConsistencyIndex = [0 , .44 , 1 , 1.63 , 2.3 ,3 , 3.73 , 4.47 , 5.23];
DATA = struct;
for i = 1:NumOfExperts
IndexOfBest = find(BestData(i , :) == 0);
IndexOfWorst = find(WorstData(: , i) == 0);
BestData(i , IndexOfBest) = 1;
WorstData(IndexOfWorst , i) = 1;
DATA(i).Best = BestData(i , :);
DATA(i).Worst = WorstData(: , i);
DATA(i).BestIndex = IndexOfBest;
DATA(i).WorstIndex = IndexOfWorst;
end
clear BestData .. WorstData .. IndexOfBest .. IndexOfWorst;
MeanWeight = zeros(1 , NumOfCriteria);
for i = 1:NumOfExperts
Data = DATA(i);
save Data
EqualCoefftMat = ones(1 , NumOfCriteria);
InitialPoints = rand(1 , NumOfCriteria);
LowerBound = zeros(1 , NumOfCriteria);
UpperBound = ones(1 , NumOfCriteria);
options = optimoptions(@fmincon , 'Algorithm' , 'interior-point' , 'MaxFunctionEvaluations' , 50000 , 'MaxIterations' , 5000 );
[DATA(i).Weights , DATA(i).Ksi] = fmincon(@Epsilon , InitialPoints , [] , [] , EqualCoefftMat , 1 , LowerBound , UpperBound , [], options);
DATA(i).ConsistencyRatio = DATA(i).Ksi/ConsistencyIndex(max(max(DATA(i).Best) , max(DATA(i).Worst)));
MeanWeight = MeanWeight + DATA(i).Weights;
end
MeanWeight = MeanWeight/NumOfExperts;
bar(MeanWeight);
xlabel('Criterias');
ylabel('Weights');
title(['Mean Of Weights is: ', num2str(mean(MeanWeight))]);
[Result.Weights , Result.IndexOfWeight] = sort(MeanWeight , 'descend');
function Out = Epsilon(x)
load Data
for i = 1:NumOfCriteria
f(i) = abs(x(Data.BestIndex)/x(i) - Data.Best(i));
g(i) = abs(x(i)/x(Data.WorstIndex) - Data.Worst(i));
end
Out = (sum(f) + sum(g) - g(Data.BestIndex))*2/NumOfCriteria;
end

7 件のコメント

Torsten
Torsten 2018 年 8 月 29 日
You implemented an optimization problem, but it's not the one you presented above.
Mostafa Eftekhary Mamaghani
Mostafa Eftekhary Mamaghani 2018 年 8 月 29 日
Yes, you're right. I had a problem understanding the procedure. At first, I wanted to implement it in linear-programming but I couldn't do it with this problem, so changed it to nonlinear form and it worked.
Torsten
Torsten 2018 年 8 月 30 日
But you are aware that you can also implement your original problem in "fmincon", aren't you ?
Mostafa Eftekhary Mamaghani
Mostafa Eftekhary Mamaghani 2018 年 8 月 30 日
Yes, I know. I wanted to implement it in linprog(as requested by my friend whom this code is for her research) but couldn't do it with the parameters was presented or at least I couldn't form the objective function based on linear programming.
JAIRAM RAIGAR
JAIRAM RAIGAR 2019 年 4 月 23 日
Can you tell me what is in data which is read from excel file ???
Mostafa Eftekhary Mamaghani
Mostafa Eftekhary Mamaghani 2019 年 5 月 1 日
Sorry for delay
It was an aggregation of questionnaires filled by experts with a fixed amount of criteria. Each criterion gets the normalized amount between 1 to 9 based on the significance of that criterion in the respective phase of the method("best" or "worst").
Soheil sadeghi
Soheil sadeghi 2021 年 5 月 6 日
Is it possible to upload an Excel file as well?
Because it seems that in the Excel file associated with this code, a set of cells are named.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeLinear Programming and Mixed-Integer Linear Programming についてさらに検索

コメント済み:

2021 年 10 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by