【线性规划LP建模实例——航空公司】

线性规划LP建模实例——航空公司

Airline - Compagnie aérienne
Required Files: airline.mod, configExe
Maximum number of files: 5
Type of work: Individual work
UNION AIRWAYS is adding more flights to and from its hub airport, and so it needs to hire additional customer service agents. However, it is not clear just how many more should be hired. Management recognizes the need for cost control while also consistently providing a satisfactory level of service to customers. Therefore, an OR team is studying how to schedule the agents to provide satisfactory service with the smallest personnel cost.
Based on the new schedule of flights, an analysis has been made of the minimum number of customer service agents that need to be on duty at different times of the day to provide a satisfactory level of service. The rightmost column of Table 1 shows the number of agents needed for the time periods given in the first column. The other entries in this table reflect one of the provisions in the company’s current contract with the union that represents the customer service agents.
The authorized shifts are
在这里插入图片描述
Checkmarks in the main body of Table 1 show the hours covered by the respective shifts. Because some shifts are less desirable than others, the wages specified in the contract differ by shift. For each shift, the daily compensation (including benefits) for each agent is shown in the bottom row. The problem is to determine how many agents should be assigned to the respective shifts each day to minimize the total personnel cost for agents, based on this bottom row, while meeting (or surpassing) the service requirements given in the rightmost column.

Model this problem as a linear program. Find the redundant constraints.

configExe

airline.mod

airline.mod

 * OPL 12.6.0.0 Model
 * Airline
 *********************************************/

//Data declarations.
//Make sure you use c[i] to access the i-th cost 
//and do not remove/change the following line
float c[1..5] = [170,160,175,180,195];

//Decision variables.
dvar float+ shift1;
dvar float+ shift2;
dvar float+ shift3;
dvar float+ shift4;
dvar float+ shift5;

//Objective function.
minimize shift1*c[1]+shift2*c[2]+shift3*c[3]+shift4*c[4]+shift5*c[5];

//Constraints
subject to {
    shift1>=48;
    shift1+shift2>=79;
    shift1+shift2>=65;
    shift1+shift2+shift3>=87;
    shift2+shift3>=64;
    shift3+shift4>=73;
    shift3+shift4>=82;
    shift4>=43;
    shift4+shift5>=52;
    shift5>=15;
}

// Display
execute {
  writeln("Post treatment: ");
  writeln("The objectif's value is  "+cplex.getObjValue());
} 

运行结果

Default LOCALE: en_US.UTF-8                                                                                                         
IBM ILOG CPLEX Optimization Studio Community Edition.  The CPLEX Optimizers will solve problems up to 1000 variables and 1000 constr
aints.                                                                                                                              
CP Optimizer (Community Edition) solves problems with a search space of up to 2^1000                                                
                                                                                                                                    
<<< setup, at 0s, took 1.64574e+09s                                                                                                 
                                                                                                                                    
                                                                                                                                    
<<< generate, at 0s, took 0.00580311s                                                                                               
                                                                                                                                    
Tried aggregator 1 time.                                                                                                            
LP Presolve eliminated 10 rows and 5 columns.                                                                                       
All rows and columns eliminated.                                                                                                    
Presolve time = 0.00 sec. (0.01 ticks)                                                                                              
                                                                                                                                    
<<< solve, at 0s, took 0.000451088s                                                                                                 
                                                                                                                                    
                                                                                                                                    
OBJECTIVE: 30610                                                                                                                    
Post treatment:                                                                                                                     
The objectif's value is  30610                                                                                                      
                                                                                                                                    
<<< post process, at 0s, took 0.000200987s                                                                                          
                                                                                                                                    
// solution (optimal) with objective 30610                                                                                          
// Quality There are no bound infeasibilities.                                                                                      
// There are no reduced-cost infeasibilities.                                                                                       
// Maximum Ax-b  residual             = 0                                                                                           
// Maximum c-B'pi residual            = 0                                                                                           
// Maximum |x|                        = 48                                                                                          
// Maximum |slack|                    = 31                                                                                          
// Maximum |pi|                       = 195                                                                                         
// Maximum |red-cost|                 = 0                                                                                           
// Condition number of unscaled basis = 1.5e+01                                                                                     
//                                                                                                                                  
                                                                                                                                    
shift1 = 48;                                                                                                                        
shift2 = 31;                                                                                                                        
shift3 = 39;                                                                                                                        
shift4 = 43;                                                                                                                        
shift5 = 15;                                                                                                                        
                                                                                                                                    
<<< done, at 0s, took 0.000262022s  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值