Using Lingo to solve salary distribution problems

Source: Internet
Author: User

The code solved with lingo is as follows:

Model
! With lingo to solve the problem of salary distribution, five people each have a different job;
Sets:
var/1..5/;
Link (var,var): c,x;
Endsets
Data
C= 3 8 2 10 3
8 7 2) 9 7
6 4 2) 7 4
8 4 2) 3 5
9 10 6 9 10;
Enddata
min= @sum (link:c*x);
@for (Var (i):
@sum (Var (j): X (I,J)) =1);
@for (Var (j):
@sum (Var (i): x (I,J)) =1);
@for (Link: @bin (x));!x11,x12,.., x15,x21,x22,.., x25,..
x51,x52,.., x55 are 0-1 variables;
End

--------------------------------------------------------------------------------------------------------------- ----

The results are as follows:

The explanations are as follows:

That is, a 5th job, b do 3rd job, C do 2nd work, Ding do 4th work, E do 1th work,

The total salary is at least 210,000 yuan.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.