Professional Documents
Culture Documents
18CSC305J Artificial Intelligence
18CSC305J Artificial Intelligence
18CSC305J Artificial Intelligence
Artificial Intelligence
RA1911031010061
RA1911031010062
RA1911031010064
RA1911031010067
RA1911031010068
RA1911031010072
Problem Description:
This function is used to compute the minimum of the values passed in its argument
and lexicographically smallest value if strings are passed as arguments.
Code:
MAX, MIN = 1000, -1000
def minimax(depth, nodeIndex, maximizingPlayer,
values, alpha, beta):
if depth == 3:
return values[nodeIndex]
if maximizingPlayer:
best = MIN
return best
else:
best = MAX
for i in range(0, 2):
return best
if __name__ == "__main__":
values = []
for i in range(0, 8):
print ("The optimal value is :", minimax(0, 0, True, values, MIN, MAX))
Output:
Result:
Min Max problem is successfully implemented using python.