Cherry
Cherry

Reputation: 1041

Does GLPK have any option for making a small fractional to 0

I am using GLPK for solving a minimization linear programming problem in octave. its giving me some variable values like 0.0000000000277 or 0.999999999999. I want to get that 0.0000000000277 as 0 and that 0.999999999999 as 1. Does GLPK has any option for doing this? Any help will be really appreciated.

Upvotes: 2

Views: 238

Answers (1)

Ram Narasimhan
Ram Narasimhan

Reputation: 22516

GLPK has an option called Solution Rounding which you can set to round off tiny values 0. Look for Solution Rounding among these options in GLPK.

However, for other values you will have to do a bit of post-processing by writing some code.

If 0.9 < x < 1.1, set x = 1 etc.

Upvotes: 3

Related Questions