带取货和送货的两步车辆路径问题

问题描述 投票:0回答:0

嗨,我必须解决一个问题,其中包含一个基于双索引节点的取货和送货问题。

网络K=(Q,P)包含一组节点Q和一组弧P。Q由仓库、存储和客户端三个子集组成(即Q = Q(W), Q(S), Q (C). P包含仓库和存储之间的弧集(P1 = {o,u},o!=u and o,u ∈ Q(W),Q(S))和存储和存储之间的弧集clients (P2 = {f,g},f!=g and f,g ∈ Q(S),Q(C))。每个弧 1.(o,u) 和 2.(f,g) 具有非负成本(distance) constraints c(o,u) and c(f,g). 有无限数量的同质汽车,容量为 K(1)(仓库-存储)和 K(2)(存储-客户)。每条路线的起点和终点都在仓库(1. arc)和同一个仓库(2. arc)。问题是将客户分配到 2. arc 中的仓库,并确定总成本(距离)最小的汽车路线。

我从仓库、存储和客户的元组开始,并用 x 和 y 坐标、送货/取货需求和容量等属性填充它们。

我不确定如何构建集合和子集。我是使用集合还是使用元组更好?我如何访问我的成本约束和决策变量的不同节点?有人对此有办法吗?非常感谢您提前提供帮助!

tuple Depots{
  key string depotID;
  int xkoordinate;
  int ykoordinate;
}
tuple Satellites{
  key string satelliteID;
  int xkoordiante;
  int ykoordinate;
  int deliverydemand;
  int pickupdemand;
  int capacity;
}
tuple Customers{
  key string customerID;
  int xkoordinate;
  int ykoordiante;
  int deliverydemand;
  int pickupdemand;
}

{Depots} depots = ;
{Satellites} satellites = ;
{Customers} customers = ;

或者这样

int ndepots = 1;
range depots = 1..ndepots;
int xkoordinate[depots] = [];
int ykoordinate[depots] = [];

int nsatellites = 2;
range satellites = 1..nsatellites;;
int xkoordinate[satellites] = [];
int ykoordinate[satellites] = [];
int deliverydemand[satellites] = [];
int pickupdemand[satellites] = [];
int capacity[satellites] = [];

int ncustomers = 9;
range customers = 1..ncustomers;;
int xkoordinate[customers] = [];
int ykoordinate[customers] = [];
int deliverydemand[customers] = [];
int pickupdemand[customers] = [];
dvar boolean x[o][u]; //1, if car travels directly from node o to node u at first step
dvar boolean y[f][g]; //1, if car travels directly from node f to node g at second step
dvar boolean z[f][o]; //1, if client f is assigned to storage o 

“决策变量中的字母仅供理解”

目标函数应该类似于以Q为节点集:

minimize sum(o in Q, u in Q) c[o][u]*x[o][u] + sum(f in Q, g in Q) c[f][g]*y[f][g];
cplex opl ilog
© www.soinside.com 2019 - 2024. All rights reserved.