Tuesday, 15 July 2014

Plot a set of inequalities for branch and bound problems in Mathematica -



Plot a set of inequalities for branch and bound problems in Mathematica -

i'm studying behavior of branch , bound algorithm in integer 2-variable linear problem. utilize wolfram alpha plotting graphs, need more robust option, mathematica. need plot viable zone of set of inequalities on r2 space (with x , y greater 0), inequalities such as:

2*x+4*y <= 12 // 6*x+2*y <= 27 // x <= 4 // x>=0 // y>=0

the graph must show integer x,y points on positive quadrant (i think mesh function can this) , specific point (solution of max/minimization problem) example, viable space in case is: http://www.wolframalpha.com/input/?i=plot%282*x%2b4*y%3c%3d12%2c6*x%2b2*y%3c%3d27%2cx%3c%3d4%2cx%3e%3d0%2cy%3e%3d0%29

thanks in advance.

the function looking regionplot:

regionplot[ 2 x + 4 y <= 12 && 6 x + 2 y <= 27 && x <= 4 && x >= 0 && y >= 0, {x, 0, 5}, {y, 0, 5}]

to create nice-looking plot on integer points inequality satisfies, here function plot it:

integerregionplot[quantifier_, {xmin_, xmax_}, {ymin_, ymax_}] := graphics[flatten[ table[if[ quantifier, {red, disk[{x, y}, 0.5]}, {blue, disk[{x, y}, 0.5]}], {x, xmin, xmax}, {y, ymin, ymax}]], frame -> true];

to plot inequality, this:

integerregionplot[ 2 x + 4 y <= 12 && 6 x + 2 y <= 27 && x <= 4 && x >= 0 && y >= 0, {0, 5}, {0, 5}]

plot wolfram-mathematica branch-and-bound

No comments:

Post a Comment