Solving a many-to-one assignment problem with additional constraints

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Assume there are $M$ items and $N$ people with $M ge N$. A single item can be
assigned to more than one person; however, item $i$ cannot be assigned more than
$d_i$ times in total. Furthermore, each item has a category $c_i$ and a single
person cannot be assigned two or more items of the same category.



The assignment of item $i$ to person $p$ produces value $v_i, p$. I would
like to find an assignment which maximizes the total value.



It should be fairly simple to write this as an, e.g., MiniZinc
model. What I am interested is whether this
resembles some optimization problem that has already been researched.







share|cite|improve this question























    up vote
    1
    down vote

    favorite












    Assume there are $M$ items and $N$ people with $M ge N$. A single item can be
    assigned to more than one person; however, item $i$ cannot be assigned more than
    $d_i$ times in total. Furthermore, each item has a category $c_i$ and a single
    person cannot be assigned two or more items of the same category.



    The assignment of item $i$ to person $p$ produces value $v_i, p$. I would
    like to find an assignment which maximizes the total value.



    It should be fairly simple to write this as an, e.g., MiniZinc
    model. What I am interested is whether this
    resembles some optimization problem that has already been researched.







    share|cite|improve this question





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Assume there are $M$ items and $N$ people with $M ge N$. A single item can be
      assigned to more than one person; however, item $i$ cannot be assigned more than
      $d_i$ times in total. Furthermore, each item has a category $c_i$ and a single
      person cannot be assigned two or more items of the same category.



      The assignment of item $i$ to person $p$ produces value $v_i, p$. I would
      like to find an assignment which maximizes the total value.



      It should be fairly simple to write this as an, e.g., MiniZinc
      model. What I am interested is whether this
      resembles some optimization problem that has already been researched.







      share|cite|improve this question











      Assume there are $M$ items and $N$ people with $M ge N$. A single item can be
      assigned to more than one person; however, item $i$ cannot be assigned more than
      $d_i$ times in total. Furthermore, each item has a category $c_i$ and a single
      person cannot be assigned two or more items of the same category.



      The assignment of item $i$ to person $p$ produces value $v_i, p$. I would
      like to find an assignment which maximizes the total value.



      It should be fairly simple to write this as an, e.g., MiniZinc
      model. What I am interested is whether this
      resembles some optimization problem that has already been researched.









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Aug 6 at 8:25









      d125q

      1,562815




      1,562815




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Your problem is actually more manageable with a greedy approach:
          1) short the $v_i,p$ values into a list
          2) for each person $p$ keep a category table where $u_p(x)=1$ if category $x$ is used and $0$ otherwise.
          3) starting from the top assign the maximum value $v_i,p$ to the total sum if $d_i>0$ and the category of item $i$ is not used by person $p$ and then assign $d_i:=d_i-1$ and set $u_p(x)=1$.
          4) the algorithm terminates when you reach the bottom value and takes time $MN$.
          It isn’t hard to prove that the correctness of this algorithm.






          share|cite|improve this answer























          • How would this maximize the total value?
            – d125q
            Aug 6 at 12:38










          • Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 12:00










          • Yes, but the flow is in no way influenced by the values $v_i, p$.
            – d125q
            Aug 7 at 12:34










          • I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:17











          • If I misunderstood your question please provide more details on what $v$ is
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:18










          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f2873697%2fsolving-a-many-to-one-assignment-problem-with-additional-constraints%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Your problem is actually more manageable with a greedy approach:
          1) short the $v_i,p$ values into a list
          2) for each person $p$ keep a category table where $u_p(x)=1$ if category $x$ is used and $0$ otherwise.
          3) starting from the top assign the maximum value $v_i,p$ to the total sum if $d_i>0$ and the category of item $i$ is not used by person $p$ and then assign $d_i:=d_i-1$ and set $u_p(x)=1$.
          4) the algorithm terminates when you reach the bottom value and takes time $MN$.
          It isn’t hard to prove that the correctness of this algorithm.






          share|cite|improve this answer























          • How would this maximize the total value?
            – d125q
            Aug 6 at 12:38










          • Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 12:00










          • Yes, but the flow is in no way influenced by the values $v_i, p$.
            – d125q
            Aug 7 at 12:34










          • I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:17











          • If I misunderstood your question please provide more details on what $v$ is
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:18














          up vote
          1
          down vote













          Your problem is actually more manageable with a greedy approach:
          1) short the $v_i,p$ values into a list
          2) for each person $p$ keep a category table where $u_p(x)=1$ if category $x$ is used and $0$ otherwise.
          3) starting from the top assign the maximum value $v_i,p$ to the total sum if $d_i>0$ and the category of item $i$ is not used by person $p$ and then assign $d_i:=d_i-1$ and set $u_p(x)=1$.
          4) the algorithm terminates when you reach the bottom value and takes time $MN$.
          It isn’t hard to prove that the correctness of this algorithm.






          share|cite|improve this answer























          • How would this maximize the total value?
            – d125q
            Aug 6 at 12:38










          • Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 12:00










          • Yes, but the flow is in no way influenced by the values $v_i, p$.
            – d125q
            Aug 7 at 12:34










          • I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:17











          • If I misunderstood your question please provide more details on what $v$ is
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:18












          up vote
          1
          down vote










          up vote
          1
          down vote









          Your problem is actually more manageable with a greedy approach:
          1) short the $v_i,p$ values into a list
          2) for each person $p$ keep a category table where $u_p(x)=1$ if category $x$ is used and $0$ otherwise.
          3) starting from the top assign the maximum value $v_i,p$ to the total sum if $d_i>0$ and the category of item $i$ is not used by person $p$ and then assign $d_i:=d_i-1$ and set $u_p(x)=1$.
          4) the algorithm terminates when you reach the bottom value and takes time $MN$.
          It isn’t hard to prove that the correctness of this algorithm.






          share|cite|improve this answer















          Your problem is actually more manageable with a greedy approach:
          1) short the $v_i,p$ values into a list
          2) for each person $p$ keep a category table where $u_p(x)=1$ if category $x$ is used and $0$ otherwise.
          3) starting from the top assign the maximum value $v_i,p$ to the total sum if $d_i>0$ and the category of item $i$ is not used by person $p$ and then assign $d_i:=d_i-1$ and set $u_p(x)=1$.
          4) the algorithm terminates when you reach the bottom value and takes time $MN$.
          It isn’t hard to prove that the correctness of this algorithm.







          share|cite|improve this answer















          share|cite|improve this answer



          share|cite|improve this answer








          edited Aug 8 at 12:21


























          answered Aug 6 at 11:23









          Μάρκος Καραμέρης

          4149




          4149











          • How would this maximize the total value?
            – d125q
            Aug 6 at 12:38










          • Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 12:00










          • Yes, but the flow is in no way influenced by the values $v_i, p$.
            – d125q
            Aug 7 at 12:34










          • I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:17











          • If I misunderstood your question please provide more details on what $v$ is
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:18
















          • How would this maximize the total value?
            – d125q
            Aug 6 at 12:38










          • Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 12:00










          • Yes, but the flow is in no way influenced by the values $v_i, p$.
            – d125q
            Aug 7 at 12:34










          • I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:17











          • If I misunderstood your question please provide more details on what $v$ is
            – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
            Aug 7 at 14:18















          How would this maximize the total value?
          – d125q
          Aug 6 at 12:38




          How would this maximize the total value?
          – d125q
          Aug 6 at 12:38












          Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 12:00




          Because maximum flow implies maximum matching in your person-item graph. The item category nodes are just for the additional $c_i$ constraints. If you read the max flow min cut algorithm on Wikipedia you will find all sorts of such applications.
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 12:00












          Yes, but the flow is in no way influenced by the values $v_i, p$.
          – d125q
          Aug 7 at 12:34




          Yes, but the flow is in no way influenced by the values $v_i, p$.
          – d125q
          Aug 7 at 12:34












          I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 14:17





          I thought $v_i,p$ was $1$ or $0$ depending on if a path person-category-item exists (has flow coming through it) or doesn’t exist
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 14:17













          If I misunderstood your question please provide more details on what $v$ is
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 14:18




          If I misunderstood your question please provide more details on what $v$ is
          – ÎœÎ¬ÏÎºÎ¿Ï‚ Καραμέρης
          Aug 7 at 14:18












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2873697%2fsolving-a-many-to-one-assignment-problem-with-additional-constraints%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?