I've written the following code and it works, but my code syntax is inefficient. This is a linear optimization with binary (0,1) integer constraints. Instead of writing each Ri as between 0 and 1 and each Ri as an integer, is the a better way to code this as a group of Ri's that must all be either 0 or 1 and hence an integer? Below is my code. It works but not tidy!!
Code Using LinearOptimization
Budget = 30 R1 + 150 R2 + 300 R3 + 25 R4 + 85 R5 + 95 R6 + 435 R7;
LinearOptimization[-(0.80 R1 + 0.75 R2 + 0.56 R3 + 0.32 R4 +
0.25 R5 + 0.86 R6 + 0.93 R7), {0 <= Budget <= 500, 0 <= R1 <= 1,
0 <= R2 <= 1, 0 <= R3 <= 1, 0 <= R4 <= 1, 0 <= R5 <= 1,
0 <= R6 <= 1, 0 <= R7 <= 1}, {R1 \[Element] Integers,
R2 \[Element] Integers, R3 \[Element] Integers,
R4 \[Element] Integers, R5 \[Element] Integers,
R6 \[Element] Integers, R7 \[Element] Integers}]
Code Using Maximize
Budget = 30 R1 + 150 R2 + 300 R3 + 25 R4 + 85 R5 + 95 R6 + 435 R7;
m = Maximize[{0.80 R1 + 0.75 R2 + 0.56 R3 + 0.32 R4 + 0.25 R5 +
0.86 R6 + 0.93 R7,
0 <= Budget <= 500, 0 <= R1 <= 1, 0 <= R2 <= 1, 0 <= R3 <= 1,
0 <= R4 <= 1, 0 <= R5 <= 1, 0 <= R6 <= 1, 0 <= R7 <= 1},
{R1, R2, R3, R4, R5, R6, R7} \[Element] Integers]
Budget /. Flatten[Last[Last[{m}]]]