Closed torressa closed 4 years ago
Is your feature request related to a problem? Please describe. Vehicle routing problem with time-windows example.
Describe the solution you'd like Implement Righini G. and Salani M. (2006) in examples/vrptw/.
examples/vrptw/
Describe alternatives you've considered Initial outline:
from networkx import DiGraph from numpy import array class VRPTW: def __init__(self, some_args): self.G = DiGraph(directed=True, n_res=2) # Populate G. Resources represent # [monotone, \tau, time-window feasibility] # And nodes with for example self.G.add_node(1, data={"time-window": (1, 2)}) self.G.add_node(2, data={"time-window": (1, 10)}) self.G.add_edge(1, 2, data={"travel-time": 1.5}, weight=10) def custom_REF(self, cumulative_res, edge): new_res = array(cumulative_res) # your filtering criteria that changes the elements of new_res # For example: head_node, tail_node, egde_data = edge[0:3] # There's a better way of doing this head_node_w_data = list( node for node in self.G.nodes(data=True) if node[0] == head_node)[0] tail_node_w_data = list( node for node in self.G.nodes(data=True) if node[0] == tail_node)[0] a_j, b_j = tail_node_w_data[1]['data']['time-window'][0:] new_res[0] += 1 # Monotone new_res[1] += max(cumulative_res[1] + edge_data['travel-time'] + edge_data['data']['travel-time'], a_j) # \tau # Update time-window feasibility resource accordingly if new_res[1] <= b_j: new_res[2] = 0 else: new_res[2] = 1 return new_res
Sweet! In a new repo https://github.com/Kuifje02/vrpy
Is your feature request related to a problem? Please describe. Vehicle routing problem with time-windows example.
Describe the solution you'd like Implement Righini G. and Salani M. (2006) in
examples/vrptw/
.Describe alternatives you've considered Initial outline:
Additional context