1 / 18

Consultant hiring problem: Modeling on AMPL

Consultant hiring problem: Modeling on AMPL. Outline of modeling process. Carefully read the problem to get a general idea Analyze each paragraph to extract all relevant data and information: Identify given data and define corresponding sets, parameters.

leena
Download Presentation

Consultant hiring problem: Modeling on AMPL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Consultant hiring problem:Modeling on AMPL

  2. Outline of modeling process • Carefully read the problem to get a general idea • Analyze each paragraph to extract all relevant data and information: • Identify given data and define corresponding sets, parameters. • 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). • 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. • Identify the constraints of the system and state them in English (will express in linear functions after defining all relevant data and variables).

  3. 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.

  4. Relevant Information from Paragraph 1 set I; # set of projects param profit{i in I}; #profits from projects excluding consulting costs

  5. Possible data for Paragraph 1 parameters and sets set I:= A B C D; param profit[*] := A 250 B 300 C 200 D 400 ;

  6. 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

  7. Possible data for Paragraph 2 parameters and sets set J:= Tom Jim Ann Tony; param cost[*] := Tom 25 Jim 36 Ann 28 Tony 30;

  8. 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;

  9. 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.

  10. 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 ;

  11. 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 ;

  12. 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

  13. 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.

  14. 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];

  15. 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];

  16. 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 ;

  17. 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];

  18. 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.

More Related