how to formulate in lp_solve() for MST graph

113 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 best solutions below