Question

Why, in many situations, must integer programming be used instead of linear programming that allows non-integer...

  • Why, in many situations, must integer programming be used instead of linear programming that allows non-integer variables? What is the purpose of 0-1 variables? What sort of problem would use them?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In a program , function can call other function, In tern calling function checks the return value from function being called. Depending on the value being returned , logic of the function which is calling this function depends. That kind of the functions should use the integer return values mainly for indicating success or failure.You can have 0 to indicate function successfully executed and 1 to indicate failure. Sometime you can use 0 as false value and 1 as true value returning from function. It is easy to compare integers than the non integers. Consider the below function

int isOdd(int num)

{

if(num%2 == 1)

return 1; //which indicates num is odd

else

return 0; //indicates num is even

}

//now consider the main program which calls isOdd function

int main()

{

if(isOdd(3) == 1)

printf("3 is odd number\n");

else

printf("3 is not odd number\n");

}

Here in main , depending on the return value from isOdd function , main prints the results.

Add a comment
Know the answer?
Add Answer to:
Why, in many situations, must integer programming be used instead of linear programming that allows non-integer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For a minimization integer linear programming problem, a feasible solution is ensured by rounding ________ non-integer...

    For a minimization integer linear programming problem, a feasible solution is ensured by rounding ________ non-integer solution values if all of the constraints are the greater-than-or-equal-to type. up and down up down up or down none of the above

  • D Question 17 0-1 Integer Programming is similar to linear programming except the variables can only...

    D Question 17 0-1 Integer Programming is similar to linear programming except the variables can only be O and 1. Consider the 0-1 Integer Programming Decision Problem (0-1 IPD) as defined below: Instance: A set X of 0-1 integer variables (x O or x, 1), a set of inequalities over these variables, a function f(x) to maximize and integer K. Question: Does there exist an assignment of values to X such that all inequalities are true and fx) K? xample...

  • You’ve been asked to develop a problem that can be used to explain some of the concepts you know to someone who has neve...

    You’ve been asked to develop a problem that can be used to explain some of the concepts you know to someone who has never heard of linear programming. 1. Formulate a maximization problem such that the following conditions are met (you may not use a problem has appeared on this assignment). Make sure to include all elements of formulation that we have discussed (i.e., objective function, constraints, non-negatives). a. LP problem with two decision variables (using X and Y as...

  • Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must...

    Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must you be careful about the order in which you change the references? b) What code would be needed to change the references in a linked list when moving up one node? c) Why did we have a previous reference in our linked list implementation? d) Write a class for a linked list node with just one constructor that allows the initialization of all instance...

  • Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must...

    Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must you be careful about the order in which you change the references? b) What code would be needed to change the references in a linked list when moving up one node? c) Why did we have a previous reference in our linked list implementation? d) Write a class for a linked list node with just one constructor that allows the initialization of all instance...

  • A company has decided to use 0-1 (binary) integer programming to help to make some investment...

    A company has decided to use 0-1 (binary) integer programming to help to make some investment decisions. There are three possible investment alternatives from which to choose, but if it is decided that a particular alternative is to be selected, the entire cost of that alternative will be incurred (i.e., it is impossible to build one-half of a factory). The integer programming model is as follows: Max 5000X1 +7000X2+9000X3 S.t. X1+X2+X3<=2 (only 2 may be chosen) 25000X1+32000X2+29000X3<=62000 (budget limit) 16X1+14X2+19X3<=36...

  • QUESTION 13 A company has decided to use 0-1 (binary) integer programming to help to make...

    QUESTION 13 A company has decided to use 0-1 (binary) integer programming to help to make some investment decisions. There are three possible investment alternatives from which to choose, but if it is decided that a particular alternative is to be selected, the entire cost of that alternative will be incurred (i.e., it is impossible to build one-half of a factory). The integer programming model is as follows: Max 5000X1+7000X2+9000X3 S.t.     X1+X2+X3<=2  (only 2 may be chosen) 25000X1+32000X2+29000X3<=62000 (budget limit)    16X1+14X2+19X3<=36  (resource...

  • QUESTION 13 A company has decided to use 0-1 (binary) integer programming to help to make...

    QUESTION 13 A company has decided to use 0-1 (binary) integer programming to help to make some investment decisions. There are three possible investment alternatives from which to choose, but if it is decided that a particular alternative is to be selected, the entire cost of that alternative will be incurred (i.e., it is impossible to build one-half of a factory). The integer programming model is as follows: Max 5000X1+7000X2+9000X3 S.t. X1+X2+X3<=2 (only 2 may be chosen) 25000X1+32000X2+29000X3<=62000 (budget limit)...

  • 5. Suppose that (x1, X2, X3) is a feasible solution to the linear programming problem 4r,...

    5. Suppose that (x1, X2, X3) is a feasible solution to the linear programming problem 4r, +2x2 + x3 minimize X12 3, 2a 23 2 4, subject to Let y and ybe non-negative numbers (a) Show that x1(y2y2)2(-y12) + x3y2 2 3y14y2 1 (b) Find constraints on yi and y2 so that 4x12 2 x1(y1 + 2¥2) + x2(-y1 + Y2) + x3Y2 1 at every feasible solution (xi, x2, X3) (c) Use parts (a) and (b) to find a...

  • Linear Programming Problem A manufacturer of three models of tote bag must determine the production plan...

    Linear Programming Problem A manufacturer of three models of tote bag must determine the production plan for the next quarter. The specifics for each model are shown in the following table. Model Revenue ($ per item) Cutting (hours per item) Sewing (hours per item) Packing (hours per item) A $8.75 .10 .05 .20 B $10.50 .15 .12 .20 C $11.50 .20 .18 .20 Time available in the three production departments are: Cutting 450 hours, Sewing 550 hours, Packing 450 hours....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT