IP modeling techniques III

Document Sample

```					Consultant hiring problem:
Modeling on AMPL

1
Outline of modeling process
1.    Carefully read the problem to get a general idea
2.    Analyze each paragraph to extract all relevant data and
information:
a) Identify given data and define corresponding sets,
parameters.
b) Identify the goal of the problem and define a corresponding
objective function (in this stage might be in English; will get
a linear function after defining all necessary data and
variables).
c) The goal can be achieved by making certain decisions.
Define decision variables when those are obviously
implied by the problem statement. More variables might be
defined later.
d) Identify the constraints of the system and state them in
English (will express in linear functions after defining all
relevant data and variables).                              2
Outline of modeling process
3. Put everything together to get a coherent model. In this stage,
all the constraints and the objective function are translated
into linear functions. Might need to define new data and
variables to accomplish it.
4. Solve by an IP software (AMPL in our case). The software
output might prompt what are the deficiencies of the model
and how those can be fixed.

3
Relevant Information from
Paragraph 1

set I; # set of projects

param profit{i in I};
#profits from projects excluding consulting costs

4
Possible data for Paragraph 1
parameters and sets

set I:= A B C D;

param profit[*] :=
A 250
B 300
C 200
D 400
;

5
Relevant Information from
Paragraph 2
set J; # set of consultants

param cost{j in J}; # weekly cost of consultant j

set ATTR; # set of K attributes

param cons_attr{j in J, k in ATTR};
# is 1 if consultant j possesses attribute k, 0 otherwise

6
Possible data for Paragraph 2
parameters and sets

set J:= Tom Jim Ann Tony;

param cost[*] :=
Tom 25
Jim 36
Ann 28
Tony 30;

7
Possible data for Paragraph 2
parameters and sets (cont.)
set ATTR:= C++ IP Linux;

param cons_attr[*,*]
:     C++ IP         Linux :=
Tom 1      0         1
Jim 1      1         0
Ann 0      1         1
Tony 1     0         1;

8
Relevant Information from
Paragraph 3
param proj_attr{i in I, k in ATTR};
# number of consultants needed to possess attribute k in project I

# Constraint 1:
# number of consultants possessing attribute k in project i
# should be at least proj_attr[i,k] if project i is pursued

# Provision: A consultant can fulfill many needs of a project.

9
Possible data for Paragraph 3
parameters and sets

param proj_attr[*,*]
:     C++ IP           Linux :=
A     2     1          2
B     1     1          1
C     2     0          1
D     2     1          0
;

10
Relevant Information from Paragraph 4
# Constraint 2:
# each consultant can work only on one project at a time

param b{i in I}; # first week of project i
param e{i in I}; # last week of project I

• Possible data for Paragraph 4 parameters and sets
param: b      e :=
A     2       4
B     1       3
C     3       5
D     2       3;
11
Relevant Information from
Paragraph 5
var proj{i in I} binary; # is 1 if project i is pursued

var assign{j in J, i in I} binary;
# is 1 if consultant j is assigned to project i

# Constraint 3:
# consultants can work only on projects that are pursued

12
Proceeding to next stage
• We are done with Stage 2, extracting
relevant data and information from each
paragraph.
• In Stage 3, we will express the objective
function and the constraints in terms of
defined variables and parameters.

13
Objective Function

maximize Profit:        # profit from projects – consultant costs
sum{i in I}profit[i]*proj[i]
- sum{j in J, i in I}cost[j]*(e[i]-b[i]+1)*assign[j,i];

14
Constraint 1
• Information we have from Stage 2:
# Constraint 1:
# number of consultants possessing attribute k in project i
# should be at least proj_attr[i,k] if project i is pursued

# Provision: A consultant can fulfill many needs of a project.

• The corresponding constraint in the model:
subject to Number_of_Consultants {i in I, k in ATTR}:
sum{j in J} cons_attr[j,k] * assign[j,i] >= proj_attr[i,k] * proj[i];

15
Constraint 2
• Information we have from Stage 2:
# Constraint 2:
# each consultant can work only on one project at a time

• Getting the corresponding constraint in the model:
# First need to define new set and parameter for time.
set WEEKS:= min{i in I}b[i]..max{i in I}e[i];
# the range of the weeks when the projects are planned
param up{w in WEEKS, i in I}:= if b[i]<=w<=e[i] then 1 else 0;
# this parameter is 1 if project i is planned to be up in week w

#Then the constraint is:
subject to one_project_at_a_time {j in J, w in WEEKS}:
sum{i in I} up[w,i] * assign[j,i] <= 1 ;                 16
Constraint 3
• Information we have from Stage 2:
# Constraint 3:
# consultants can work only on projects that are pursued

• The corresponding constraint in the model:
subject to only_pursued_projects {i in I, j in J}:
assign[j,i] <= proj[i];

17
Summarizing
• Put all the sets, parameters, variables,
constraints and the objective function
together to get a complete model.
• The complete model along with a possible
data set is given in the handout.

18

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 0 posted: 9/14/2012 language: English pages: 18