0

I'm working on a problem on Trees. I'm trying to write an ILP formulation. I have a tree T=(V,E) V are vertices E are edges. One of my constraints is about connectivity and i want to formulate my statement which is: if X[i,j] =1; then X[parent_i,i] = 1. X is binary variable indicating we select that node in solution if it's in solution 1 else 0. i,j are elements of V How can i formulate this?

Thanks in advance.

Berkehan
  • 77
  • 1
  • 10

2 Answers2

1

For A, B in {0, 1}, [A = 1 ⇒ B = 1] ⇔ [A ≤ B].

Timothy Shields
  • 75,459
  • 18
  • 120
  • 173
0

I come with a solution i used parent relation with nodes. Solution is: X(parent[parent[i]],parent[i])-X(Parent[i],i)>=0. Lets say we have k-->i-->j hierachy there are 3 possibility: fisrtly k,i and i,j both may be 0, secondly both may be 1; at last k,i may be 1 and i,j may be 0. But k,i can't be 0 when i,j is 1. So (k,i) - (i,j) must be greater and equal to 0.

Berkehan
  • 77
  • 1
  • 10