how to formulate in lp_solve() for MST graph

83 views Asked by At

I am an amateur to Python and PuLP.

That said I am currently stumbling over the syntax of PuLP. I tried to search in many places, I only found basic examples with variables having one index or simple sums.

The following is the basic problem I want to implement:

minimize :-  summation of C(i,j)*X(i,j)     where (i,jāˆˆ E)
#constrains:
Subject To:-  summation of X(i,j) =n-1

summation of X(i,j) >= 1   where (i,jāˆˆ E)

X(i,j) āˆˆ {0, 1}  where for all  (i,jāˆˆ E)

Now I can't figure out how to formulate the objective function, nor the constraints with multiple indices.

Can you tell me how to formulate this?

0

There are 0 answers