help-glpk
[Top][All Lists]

## [Help-glpk] Newbie Question

 From: Mark Dyer Subject: [Help-glpk] Newbie Question Date: Sat, 9 Aug 2008 18:44:57 +0400

```I am trying to write a model to maximize overall output when selecting personnel
given a budget, the salary of each potential person and their output ability.

The problem I have is writing a rule where one person will be choosen as team
leader and their output will be calculated as double.

Please, could someone help me with this?

Thanks.

/* sets */
set PERSON;
set POSITIONS;
/* parameters */
param num_of_positions {i in POSITIONS};
param salary {i in PERSON};
param output {i in PERSON};
param position {i in PERSON, j in POSITIONS};
/* decision variables: yi, i in {1,..,7}. yi = 1 -> person i is hired */
var y {i in PERSON} binary >=0;
/* objective function */
maximize z: sum{i in PERSON} output[i]*y[i];
/* Constraints */
s.t. pos{j in POSITIONS}: sum{i in PERSON}
position[i,j]*y[i] = num_of_positions[j];
s.t. people: sum{i in PERSON} y[i] = 12;
s.t. budget: sum{i in PERSON} salary[i]*y[i] <= 1150000;

data;
set PERSON := 1 2 3 ... 100;
set POSITIONS := A B C D E;

param num_of_positions :=
A     1
B     5
C     3
D     2
E     1;

param salary:=
1   90000
2   90000
3   70000
.
.
98  61000
99  58000
100 67000;

param output:=
1   22
2   93
3   14
.
.
98  41
99  10
100 16;

param position: A B C D E:=
1               1 0 0 0 0
2               0 0 1 0 0
3               0 1 0 0 0
.
.
98              0 1 0 0 0
99              0 0 0 0 1
100             1 0 0 0 0;

Sell your car for just \$40 at CarPoint.com.au It's simple!
```
 I am trying to write a model to maximize overall output when selecting personnel given a budget, the salary of each potential person and their output ability.   The problem I have is writing a rule where one person will be choosen as team leader and their output will be calculated as double.   Please, could someone help me with this?   Thanks.   /* sets */set PERSON;set POSITIONS; /* parameters */param num_of_positions {i in POSITIONS};param salary {i in PERSON};param output {i in PERSON};param position {i in PERSON, j in POSITIONS}; /* decision variables: yi, i in {1,..,7}. yi = 1 -> person i is hired */var y {i in PERSON} binary >=0; /* objective function */maximize z: sum{i in PERSON} output[i]*y[i]; /* Constraints */s.t. pos{j in POSITIONS}: sum{i in PERSON}       position[i,j]*y[i] = num_of_positions[j];s.t. people: sum{i in PERSON} y[i] = 12;s.t. budget: sum{i in PERSON} salary[i]*y[i] <= 1150000; data;set PERSON := 1 2 3 ... 100;set POSITIONS := A B C D E;   param num_of_positions :=A     1B     5C     3D     2E     1;   param salary:=1   900002   900003   70000..98  6100099  58000100 67000;   param output:=1   222   933   14..98  4199  10100 16; param position: A B C D E:=1               1 0 0 0 02               0 0 1 0 03               0 1 0 0 0..98              0 1 0 0 099              0 0 0 0 1100             1 0 0 0 0;Sell your car for just \$40 at CarPoint.com.au It's simple!