I am trying to solve the following equation:
maximize x^{T}Ax where x is a 3 X 1 vector of the variables to be maximized and A is a 3 X 3 matrix of values.
So basically x^{T} = [a,b,c] which are the unknowns to be maximized and A could be something like
A = [ [29, 29, 79],
[28, 28, 48],
[9, 40, 0 ]]
Could someone show me how to represent this in the form of a maximization problem using PuLP or some other linear programming package in python?
Any help would be much appreciated. I am extremely new to this area and have not idea how to get started representing this formulation.
I have so far tried to use CVXPY to model this function. I have the following code but am seeing an error:
[1] A = np.array([[29,29,79],[28,28,48],[9,40,0]])
[2] x=Variable(3)
[3] objective=Minimize(x.T*A*x)
Warning: Forming a nonconvex expression (affine)*(affine).
warnings.warn("Forming a nonconvex expression (affine)*(affine).")
[4] constraints=[0<=x,x<=1,sum_entries(x)==1] #what I'm trying to say is each entry of x should be between 0 and 1 and all entries should add up to 1.
[5] prob = Problem(objective, constraints)
[6] prob.solve()
DCPError: Problem does not follow DCP rules.