Sure, I understand what you are asking. Below is the Python code implementing the Fuzzy TOPSIS method for the provided inputs. Before we start, please remember that Fuzzy TOPSIS is a multi-criteria decision-making approach that extends the traditional TOPSIS method by using fuzzy numbers to handle uncertainty and imprecision in the assessment of criteria and alternatives.
The inputs are two decision matrices from two decision-makers and their corresponding weight matrices. We combine these inputs to form a single decision matrix and weight matrix by averaging the contribution from each decision-maker. Then we apply the TOPSIS method to the combined decision matrix with a negative criterion (cost) and positive criteria (others).
Here's the Python code:
import numpy as np
# Decision matrices from two decision makers
d1 = [
[[233.4, 233.4, 233.4], [1, 3, 5], [5, 7, 9]],
[[256.2, 256.2, 256.2], [7, 9, 10], [3, 5, 7]],
[[248.2, 248.2, 248.2], [3, 5, 7], [7, 9, 10]]
]
d2 = [
[[233.4, 233.4, 233.4], [0, 1, 3], [9, 10, 10]],
[[256.2, 256.2, 256.2], [3, 5, 7], [9, 10, 10]],
[[248.2, 248.2, 248.2], [7, 9, 10], [7, 9, 10]]
]
# Weight matrices from two decision makers
w1 = [[[0.7, 0.1, 0], [0.9, 0.3, 0.1], [1, 0.5, 0.3]]]
w2 = [[[0.7, 0.5, 0.7], [0.9, 0.7, 0.9], [1, 0.9, 1]]]
# Convert lists to numpy arrays for easier matrix operations
d1 = np.array(d1)
d2 = np.array(d2)
w1 = np.array(w1)
w2 = np.array(w2)
# Combine the decision matrices and weight matrices by taking their average
decision_matrix = (d1 + d2) / 2
weight_matrix = (w1 + w2) / 2
# Normalize the decision matrix
normalized_decision_matrix = np.zeros(decision_matrix.shape)
for i in range(normalized_decision_matrix.shape[1]):
for j in range(normalized_decision_matrix.shape[2]):
column = decision_matrix[:, i, j]
normalized_decision_matrix[:, i, j] = column / np.sqrt(np.sum(column**2))
# Apply weights to the normalized decision matrix
weighted_normalized_decision_matrix = normalized_decision_matrix * weight_matrix
# Determine the fuzzy positive ideal solution (FPIS) and fuzzy negative ideal solution (FNIS)
fpis = np.max(weighted_normalized_decision_matrix[:, :, :], axis=0)
fnis = np.min(weighted_normalized_decision_matrix[:, :, :], axis=0)
# Calculate the distance of each alternative to FPIS and FNIS
distance_to_fpis = np.sqrt(np.sum((weighted_normalized_decision_matrix - fpis)**2, axis=(1, 2)))
distance_to_fnis = np.sqrt(np.sum((weighted_normalized_decision_matrix - fnis)**2, axis=(1, 2)))
# Calculate the relative closeness to the ideal solution
relative_closeness = distance_to_fnis / (distance_to_fnis + distance_to_fpis)
# Print the relative closeness matrix (1x3 vector)
print("Relative Closeness:", relative_closeness)
When you run this code, it will output the relative closeness matrix (1x3 vector) which indicates how close each alternative is to the ideal solution. The alternative with the highest relative closeness is generally considered the best choice. Keep in mind that this is a simplified representation of the Fuzzy TOPSIS method and doesn't cover some complexities that might exist in full implementations.