Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

p.show() at MixedIntegerLinearProgram results

? would appreciate it if someone could explain me how the p.show() method works (p=MixedIntegerLinearProgram)... More precisely : lets say we have the following Linear Program:

p=MixedIntegerLinearProgram()
w=p.new_variable()
p.add_constraint(w[0]+w[2]<=4)
p.add_constraint(-w[0]+w[2]+2*w[3]==4)
p.add_constraint(w[0]+w[1]+w[3]==3)
p.set_objective(w[0]- w[1]) #<---- Look here

the result from p.show() is

Maximization:
  x_0 -x_3   #<----and here
Constraints:
  4.0 <= -x_0 +x_1 +2.0 x_2 <= 4.0
  3.0 <= x_0 +x_2 +x_3 <= 3.0
Variables:
  x_0 is a continuous variable (min=0.0, max=+oo)
  x_1 is a continuous variable (min=0.0, max=+oo)
  x_2 is a continuous variable (min=0.0, max=+oo)
  x_3 is a continuous variable (min=0.0, max=+oo)

why SAGE shows a different objective function?

p.show() at MixedIntegerLinearProgram results

? I would appreciate it if someone could explain me how the p.show() method works (p=MixedIntegerLinearProgram)... More precisely : lets say we have the following Linear Program:

p=MixedIntegerLinearProgram()
w=p.new_variable()
p.add_constraint(w[0]+w[2]<=4)
p.add_constraint(-w[0]+w[2]+2*w[3]==4)
p.add_constraint(w[0]+w[1]+w[3]==3)
p.set_objective(w[0]- w[1]) #<---- Look here

the result from p.show() is

Maximization:
  x_0 -x_3   #<----and here
Constraints:
  4.0 <= -x_0 +x_1 +2.0 x_2 <= 4.0
  3.0 <= x_0 +x_2 +x_3 <= 3.0
Variables:
  x_0 is a continuous variable (min=0.0, max=+oo)
  x_1 is a continuous variable (min=0.0, max=+oo)
  x_2 is a continuous variable (min=0.0, max=+oo)
  x_3 is a continuous variable (min=0.0, max=+oo)

why SAGE shows a different objective function?

p.show() at MixedIntegerLinearProgram results

I would appreciate it if someone could explain me how the p.show() method works (p=MixedIntegerLinearProgram)... More precisely : lets say we have the following Linear Program:

p=MixedIntegerLinearProgram()
w=p.new_variable()
p.add_constraint(w[0]+w[2]<=4)
p.add_constraint(-w[0]+w[2]+2*w[3]==4)
p.add_constraint(w[0]+w[1]+w[3]==3)
p.set_objective(w[0]- w[1]) #<---- Look here

the result from p.show() is

Maximization:
  x_0 -x_3   #<----and here
Constraints:
  4.0 <= -x_0 +x_1 +2.0 x_2 <= 4.0
  3.0 <= x_0 +x_2 +x_3 <= 3.0
Variables:
  x_0 is a continuous variable (min=0.0, max=+oo)
  x_1 is a continuous variable (min=0.0, max=+oo)
  x_2 is a continuous variable (min=0.0, max=+oo)
  x_3 is a continuous variable (min=0.0, max=+oo)

why SAGE shows a different objective function?