Solving an LP problem with an upper limit for the variables











up vote
0
down vote

favorite
2












enter image description here



Im trying to solve the Above LP. Now, can we apply just simplex considering that we can treat the upper bounds of the variables as constraints.



Meaning, we need to add $6$ slack variables, and it would be a bit harder to do the algorithm by hand. Now, the dual will give six variables as well, so it doesnt help much.



In my notes, it says to consider "bounded variable simplex method", but I haven't seen how this method works. how can we apply this method to solve this problem? Is it possible to solve it using the standard primal simplex?










share|cite|improve this question















This question has an open bounty worth +150
reputation from Jimmy Sabater ending in 3 days.


Looking for an answer drawing from credible and/or official sources.












  • 1




    Here is a algorithm for Bounded Variables with examples.
    – callculus
    Nov 16 at 12:24










  • What more do you expect from an answer than the algorithm callculus linked to?
    – LinAlg
    Nov 18 at 13:57










  • LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
    – Jimmy Sabater
    2 days ago










  • Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
    – LinAlg
    2 days ago

















up vote
0
down vote

favorite
2












enter image description here



Im trying to solve the Above LP. Now, can we apply just simplex considering that we can treat the upper bounds of the variables as constraints.



Meaning, we need to add $6$ slack variables, and it would be a bit harder to do the algorithm by hand. Now, the dual will give six variables as well, so it doesnt help much.



In my notes, it says to consider "bounded variable simplex method", but I haven't seen how this method works. how can we apply this method to solve this problem? Is it possible to solve it using the standard primal simplex?










share|cite|improve this question















This question has an open bounty worth +150
reputation from Jimmy Sabater ending in 3 days.


Looking for an answer drawing from credible and/or official sources.












  • 1




    Here is a algorithm for Bounded Variables with examples.
    – callculus
    Nov 16 at 12:24










  • What more do you expect from an answer than the algorithm callculus linked to?
    – LinAlg
    Nov 18 at 13:57










  • LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
    – Jimmy Sabater
    2 days ago










  • Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
    – LinAlg
    2 days ago















up vote
0
down vote

favorite
2









up vote
0
down vote

favorite
2






2





enter image description here



Im trying to solve the Above LP. Now, can we apply just simplex considering that we can treat the upper bounds of the variables as constraints.



Meaning, we need to add $6$ slack variables, and it would be a bit harder to do the algorithm by hand. Now, the dual will give six variables as well, so it doesnt help much.



In my notes, it says to consider "bounded variable simplex method", but I haven't seen how this method works. how can we apply this method to solve this problem? Is it possible to solve it using the standard primal simplex?










share|cite|improve this question













enter image description here



Im trying to solve the Above LP. Now, can we apply just simplex considering that we can treat the upper bounds of the variables as constraints.



Meaning, we need to add $6$ slack variables, and it would be a bit harder to do the algorithm by hand. Now, the dual will give six variables as well, so it doesnt help much.



In my notes, it says to consider "bounded variable simplex method", but I haven't seen how this method works. how can we apply this method to solve this problem? Is it possible to solve it using the standard primal simplex?







linear-programming






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 16 at 7:11









Jimmy Sabater

1,829218




1,829218






This question has an open bounty worth +150
reputation from Jimmy Sabater ending in 3 days.


Looking for an answer drawing from credible and/or official sources.








This question has an open bounty worth +150
reputation from Jimmy Sabater ending in 3 days.


Looking for an answer drawing from credible and/or official sources.










  • 1




    Here is a algorithm for Bounded Variables with examples.
    – callculus
    Nov 16 at 12:24










  • What more do you expect from an answer than the algorithm callculus linked to?
    – LinAlg
    Nov 18 at 13:57










  • LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
    – Jimmy Sabater
    2 days ago










  • Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
    – LinAlg
    2 days ago
















  • 1




    Here is a algorithm for Bounded Variables with examples.
    – callculus
    Nov 16 at 12:24










  • What more do you expect from an answer than the algorithm callculus linked to?
    – LinAlg
    Nov 18 at 13:57










  • LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
    – Jimmy Sabater
    2 days ago










  • Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
    – LinAlg
    2 days ago










1




1




Here is a algorithm for Bounded Variables with examples.
– callculus
Nov 16 at 12:24




Here is a algorithm for Bounded Variables with examples.
– callculus
Nov 16 at 12:24












What more do you expect from an answer than the algorithm callculus linked to?
– LinAlg
Nov 18 at 13:57




What more do you expect from an answer than the algorithm callculus linked to?
– LinAlg
Nov 18 at 13:57












LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
– Jimmy Sabater
2 days ago




LinAlg The example in the link is different than my problem. I dont see a way to apply what is on this link to this actual problem.
– Jimmy Sabater
2 days ago












Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
– LinAlg
2 days ago






Could you add to your question where you get stuck? The examples on pages 5-8 seem to cover your needs.
– LinAlg
2 days ago












1 Answer
1






active

oldest

votes

















up vote
3
down vote













Let's write down our simplex table, remembering our upper bounds for each variables.



begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
& x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
-z & -2 & -4 & color{blue}{-7} & -1 & -5 & 0 & 1 & 0 & - & - \ hline
s & 3 & 5 & 11 & 2 & 7 & 1 & 0 & 10 & frac{10}{11} & 1 \ hline
end{array}



At the beginning, we are at $(x_1,x_2,x_3,x_4,x_5)=(0,0,0,0,0)$. The entering variable would be $x_3$. since the minimum ratio is less than the upper bound, we will do a regular simplex pivot updating.



begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
& x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
-z & -frac1{11} & color{blue}{-frac9{11}} & 0 & frac3{11} & -frac6{11} & frac7{11} & 1 & frac{70}{11} & - & - \ hline
x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{10}{11} & 2 & 1 \ hline
end{array}



Upon doing the simplex update, we reach $(0,0,frac{10}{11},0,0)$. Our next entering variable is $x_2$. The difference from the previous step this time is the ratio is more than the upper bound. We will increment the $x_2$ by the upperbound amount, which is $1$. We will also update the RHS and mark $x_2$ as $bar{x}_2$ to indicate that it is now non-basic.



begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
& x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
-z & -frac1{11} & -frac9{11} & 0 & frac3{11} & color{blue}{-frac6{11}} & frac7{11} & 1 & frac{79}{11} & - & - \ hline
x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{5}{11} & frac57 & 1 \ hline
end{array}



Now, we arrive at $(0,1,frac5{11},0,0)$. Our next entering variable is $x_5$, since the ratio is less than the upper bound, we do a regular simplex pivot updating.



begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
& x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
-z & frac1{7} & -frac3{7} & frac67 & frac3{7} & 0 & frac5{7} & 1 & frac{53}{7} & - & - \ hline
x_5 & frac3{7} & frac5{7} & frac{11}7 & frac2{7} & 1 & frac1{7} & 0 & frac{5}{7} & - & - \ hline
end{array}



Now, we arrive at $(0,1,0,0,frac57)$. Upon checking the reduced cost, we can see that we are optimal with objective value $frac{53}{7}$.



R code to check the final solution:



> library(lpSolve)
> f.obj <- c(2,4,7,1,5)
> n = length(f.obj)
> f.con <- rbind(c(3,5,11,2,7), diag(n), -diag(n))
> f.dir <- rep('<=',2 * n+1 )
> f.rhs <- c(10,rep(1,n),rep(0,n))
> optimum <- lp(direction = "max", objective.in = f.obj, const.mat = f.con, const.dir = f.dir, const.rhs = f.rhs)
> optimum
Success: the objective function is 7.571429
> optimum$solution
[1] 0.0000000 1.0000000 0.0000000 0.0000000 0.7142857





share|cite|improve this answer























    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000829%2fsolving-an-lp-problem-with-an-upper-limit-for-the-variables%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    Let's write down our simplex table, remembering our upper bounds for each variables.



    begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
    & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
    -z & -2 & -4 & color{blue}{-7} & -1 & -5 & 0 & 1 & 0 & - & - \ hline
    s & 3 & 5 & 11 & 2 & 7 & 1 & 0 & 10 & frac{10}{11} & 1 \ hline
    end{array}



    At the beginning, we are at $(x_1,x_2,x_3,x_4,x_5)=(0,0,0,0,0)$. The entering variable would be $x_3$. since the minimum ratio is less than the upper bound, we will do a regular simplex pivot updating.



    begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
    & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
    -z & -frac1{11} & color{blue}{-frac9{11}} & 0 & frac3{11} & -frac6{11} & frac7{11} & 1 & frac{70}{11} & - & - \ hline
    x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{10}{11} & 2 & 1 \ hline
    end{array}



    Upon doing the simplex update, we reach $(0,0,frac{10}{11},0,0)$. Our next entering variable is $x_2$. The difference from the previous step this time is the ratio is more than the upper bound. We will increment the $x_2$ by the upperbound amount, which is $1$. We will also update the RHS and mark $x_2$ as $bar{x}_2$ to indicate that it is now non-basic.



    begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
    & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
    -z & -frac1{11} & -frac9{11} & 0 & frac3{11} & color{blue}{-frac6{11}} & frac7{11} & 1 & frac{79}{11} & - & - \ hline
    x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{5}{11} & frac57 & 1 \ hline
    end{array}



    Now, we arrive at $(0,1,frac5{11},0,0)$. Our next entering variable is $x_5$, since the ratio is less than the upper bound, we do a regular simplex pivot updating.



    begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
    & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
    -z & frac1{7} & -frac3{7} & frac67 & frac3{7} & 0 & frac5{7} & 1 & frac{53}{7} & - & - \ hline
    x_5 & frac3{7} & frac5{7} & frac{11}7 & frac2{7} & 1 & frac1{7} & 0 & frac{5}{7} & - & - \ hline
    end{array}



    Now, we arrive at $(0,1,0,0,frac57)$. Upon checking the reduced cost, we can see that we are optimal with objective value $frac{53}{7}$.



    R code to check the final solution:



    > library(lpSolve)
    > f.obj <- c(2,4,7,1,5)
    > n = length(f.obj)
    > f.con <- rbind(c(3,5,11,2,7), diag(n), -diag(n))
    > f.dir <- rep('<=',2 * n+1 )
    > f.rhs <- c(10,rep(1,n),rep(0,n))
    > optimum <- lp(direction = "max", objective.in = f.obj, const.mat = f.con, const.dir = f.dir, const.rhs = f.rhs)
    > optimum
    Success: the objective function is 7.571429
    > optimum$solution
    [1] 0.0000000 1.0000000 0.0000000 0.0000000 0.7142857





    share|cite|improve this answer



























      up vote
      3
      down vote













      Let's write down our simplex table, remembering our upper bounds for each variables.



      begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
      & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
      -z & -2 & -4 & color{blue}{-7} & -1 & -5 & 0 & 1 & 0 & - & - \ hline
      s & 3 & 5 & 11 & 2 & 7 & 1 & 0 & 10 & frac{10}{11} & 1 \ hline
      end{array}



      At the beginning, we are at $(x_1,x_2,x_3,x_4,x_5)=(0,0,0,0,0)$. The entering variable would be $x_3$. since the minimum ratio is less than the upper bound, we will do a regular simplex pivot updating.



      begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
      & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
      -z & -frac1{11} & color{blue}{-frac9{11}} & 0 & frac3{11} & -frac6{11} & frac7{11} & 1 & frac{70}{11} & - & - \ hline
      x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{10}{11} & 2 & 1 \ hline
      end{array}



      Upon doing the simplex update, we reach $(0,0,frac{10}{11},0,0)$. Our next entering variable is $x_2$. The difference from the previous step this time is the ratio is more than the upper bound. We will increment the $x_2$ by the upperbound amount, which is $1$. We will also update the RHS and mark $x_2$ as $bar{x}_2$ to indicate that it is now non-basic.



      begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
      & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
      -z & -frac1{11} & -frac9{11} & 0 & frac3{11} & color{blue}{-frac6{11}} & frac7{11} & 1 & frac{79}{11} & - & - \ hline
      x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{5}{11} & frac57 & 1 \ hline
      end{array}



      Now, we arrive at $(0,1,frac5{11},0,0)$. Our next entering variable is $x_5$, since the ratio is less than the upper bound, we do a regular simplex pivot updating.



      begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
      & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
      -z & frac1{7} & -frac3{7} & frac67 & frac3{7} & 0 & frac5{7} & 1 & frac{53}{7} & - & - \ hline
      x_5 & frac3{7} & frac5{7} & frac{11}7 & frac2{7} & 1 & frac1{7} & 0 & frac{5}{7} & - & - \ hline
      end{array}



      Now, we arrive at $(0,1,0,0,frac57)$. Upon checking the reduced cost, we can see that we are optimal with objective value $frac{53}{7}$.



      R code to check the final solution:



      > library(lpSolve)
      > f.obj <- c(2,4,7,1,5)
      > n = length(f.obj)
      > f.con <- rbind(c(3,5,11,2,7), diag(n), -diag(n))
      > f.dir <- rep('<=',2 * n+1 )
      > f.rhs <- c(10,rep(1,n),rep(0,n))
      > optimum <- lp(direction = "max", objective.in = f.obj, const.mat = f.con, const.dir = f.dir, const.rhs = f.rhs)
      > optimum
      Success: the objective function is 7.571429
      > optimum$solution
      [1] 0.0000000 1.0000000 0.0000000 0.0000000 0.7142857





      share|cite|improve this answer

























        up vote
        3
        down vote










        up vote
        3
        down vote









        Let's write down our simplex table, remembering our upper bounds for each variables.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -2 & -4 & color{blue}{-7} & -1 & -5 & 0 & 1 & 0 & - & - \ hline
        s & 3 & 5 & 11 & 2 & 7 & 1 & 0 & 10 & frac{10}{11} & 1 \ hline
        end{array}



        At the beginning, we are at $(x_1,x_2,x_3,x_4,x_5)=(0,0,0,0,0)$. The entering variable would be $x_3$. since the minimum ratio is less than the upper bound, we will do a regular simplex pivot updating.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -frac1{11} & color{blue}{-frac9{11}} & 0 & frac3{11} & -frac6{11} & frac7{11} & 1 & frac{70}{11} & - & - \ hline
        x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{10}{11} & 2 & 1 \ hline
        end{array}



        Upon doing the simplex update, we reach $(0,0,frac{10}{11},0,0)$. Our next entering variable is $x_2$. The difference from the previous step this time is the ratio is more than the upper bound. We will increment the $x_2$ by the upperbound amount, which is $1$. We will also update the RHS and mark $x_2$ as $bar{x}_2$ to indicate that it is now non-basic.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -frac1{11} & -frac9{11} & 0 & frac3{11} & color{blue}{-frac6{11}} & frac7{11} & 1 & frac{79}{11} & - & - \ hline
        x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{5}{11} & frac57 & 1 \ hline
        end{array}



        Now, we arrive at $(0,1,frac5{11},0,0)$. Our next entering variable is $x_5$, since the ratio is less than the upper bound, we do a regular simplex pivot updating.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & frac1{7} & -frac3{7} & frac67 & frac3{7} & 0 & frac5{7} & 1 & frac{53}{7} & - & - \ hline
        x_5 & frac3{7} & frac5{7} & frac{11}7 & frac2{7} & 1 & frac1{7} & 0 & frac{5}{7} & - & - \ hline
        end{array}



        Now, we arrive at $(0,1,0,0,frac57)$. Upon checking the reduced cost, we can see that we are optimal with objective value $frac{53}{7}$.



        R code to check the final solution:



        > library(lpSolve)
        > f.obj <- c(2,4,7,1,5)
        > n = length(f.obj)
        > f.con <- rbind(c(3,5,11,2,7), diag(n), -diag(n))
        > f.dir <- rep('<=',2 * n+1 )
        > f.rhs <- c(10,rep(1,n),rep(0,n))
        > optimum <- lp(direction = "max", objective.in = f.obj, const.mat = f.con, const.dir = f.dir, const.rhs = f.rhs)
        > optimum
        Success: the objective function is 7.571429
        > optimum$solution
        [1] 0.0000000 1.0000000 0.0000000 0.0000000 0.7142857





        share|cite|improve this answer














        Let's write down our simplex table, remembering our upper bounds for each variables.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -2 & -4 & color{blue}{-7} & -1 & -5 & 0 & 1 & 0 & - & - \ hline
        s & 3 & 5 & 11 & 2 & 7 & 1 & 0 & 10 & frac{10}{11} & 1 \ hline
        end{array}



        At the beginning, we are at $(x_1,x_2,x_3,x_4,x_5)=(0,0,0,0,0)$. The entering variable would be $x_3$. since the minimum ratio is less than the upper bound, we will do a regular simplex pivot updating.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & x_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -frac1{11} & color{blue}{-frac9{11}} & 0 & frac3{11} & -frac6{11} & frac7{11} & 1 & frac{70}{11} & - & - \ hline
        x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{10}{11} & 2 & 1 \ hline
        end{array}



        Upon doing the simplex update, we reach $(0,0,frac{10}{11},0,0)$. Our next entering variable is $x_2$. The difference from the previous step this time is the ratio is more than the upper bound. We will increment the $x_2$ by the upperbound amount, which is $1$. We will also update the RHS and mark $x_2$ as $bar{x}_2$ to indicate that it is now non-basic.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & -frac1{11} & -frac9{11} & 0 & frac3{11} & color{blue}{-frac6{11}} & frac7{11} & 1 & frac{79}{11} & - & - \ hline
        x_3 & frac3{11} & frac5{11} & 1 & frac2{11} & frac7{11} & frac1{11} & 0 & frac{5}{11} & frac57 & 1 \ hline
        end{array}



        Now, we arrive at $(0,1,frac5{11},0,0)$. Our next entering variable is $x_5$, since the ratio is less than the upper bound, we do a regular simplex pivot updating.



        begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}hline
        & x_1 & bar{x}_2 & x_3 & x_4 & x_5 & s & -z & RHS & text{ratio} &UB \ hline
        -z & frac1{7} & -frac3{7} & frac67 & frac3{7} & 0 & frac5{7} & 1 & frac{53}{7} & - & - \ hline
        x_5 & frac3{7} & frac5{7} & frac{11}7 & frac2{7} & 1 & frac1{7} & 0 & frac{5}{7} & - & - \ hline
        end{array}



        Now, we arrive at $(0,1,0,0,frac57)$. Upon checking the reduced cost, we can see that we are optimal with objective value $frac{53}{7}$.



        R code to check the final solution:



        > library(lpSolve)
        > f.obj <- c(2,4,7,1,5)
        > n = length(f.obj)
        > f.con <- rbind(c(3,5,11,2,7), diag(n), -diag(n))
        > f.dir <- rep('<=',2 * n+1 )
        > f.rhs <- c(10,rep(1,n),rep(0,n))
        > optimum <- lp(direction = "max", objective.in = f.obj, const.mat = f.con, const.dir = f.dir, const.rhs = f.rhs)
        > optimum
        Success: the objective function is 7.571429
        > optimum$solution
        [1] 0.0000000 1.0000000 0.0000000 0.0000000 0.7142857






        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited 2 days ago

























        answered 2 days ago









        Siong Thye Goh

        93.1k1462114




        93.1k1462114






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000829%2fsolving-an-lp-problem-with-an-upper-limit-for-the-variables%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith