├── ADMM-VRP-CHI.pdf
├── ADMM_based_framework.py
├── ADMM_for_Solomon_and_Jingdong_Refactoring
├── ADMM Solomon C101.100
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── ADMM Solomon C101.100.iml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── misc.xml
│ │ └── modules.xml
│ ├── C101_100_ADMM.py
│ ├── README.md
│ ├── input
│ │ ├── input_link.csv
│ │ └── input_node.csv
│ └── output
│ │ ├── fig_global_gap.svg
│ │ ├── fig_local_gap.svg
│ │ ├── fig_path.svg
│ │ ├── output_gap.csv
│ │ ├── output_path.csv
│ │ └── output_profit.csv
├── ADMM Solomon RC101.100
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ └── 【ADMM】Solomon RC101.100.iml
│ ├── 100-ADMM-for-solomonRc.py
│ ├── input
│ │ ├── input_link.csv
│ │ └── input_node.csv
│ └── output
│ │ ├── fig_gap.svg
│ │ ├── fig_path.svg
│ │ ├── log.txt
│ │ ├── output_gap.csv
│ │ ├── output_path.csv
│ │ └── output_profit.csv
└── ADMM_Jingdong
│ ├── ADMM_Python1+2.py
│ ├── input
│ ├── input_link_100.csv
│ └── input_node_100.csv
│ └── output
│ ├── OutputLog.docx
│ ├── output_gap.csv
│ ├── output_path.csv
│ ├── output_profit.csv
│ └── plot_output
│ └── code_no1
│ ├── .ipynb_checkpoints
│ └── plot_jupyter-checkpoint.ipynb
│ ├── fig_gap.svg
│ ├── input_link_100.csv
│ ├── input_node_100.csv
│ ├── optimal_path.svg
│ ├── optimal_path.xlsx
│ ├── output_gap.csv
│ ├── output_path.csv
│ ├── output_profit.csv
│ └── plot_jupyter.ipynb
├── DSSR_ng_route.py
├── JingdongDataset_v2.zip
├── P-VRP
├── P-n16-k8.vrp
├── P-n19-k2.vrp
├── P-n20-k2.vrp
├── P-n21-k2.vrp
├── P-n22-k2.vrp
└── P-n22-k8.vrp
├── SPPRC.py
├── SolomonDataset_v2.zip
├── define_class.py
├── main.py
├── paraVRP.py
└── read_input.py
/ADMM-VRP-CHI.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/ADMM-VRP-CHI.pdf
--------------------------------------------------------------------------------
/ADMM_based_framework.py:
--------------------------------------------------------------------------------
1 | # coding=gb18030
2 | __author__ = 'Yao'
3 | import DSSR_ng_route
4 | from define_class import *
5 | import numpy as np
6 | import copy
7 | class ADMM_ITER():
8 | def __init__(self):
9 | self.number_of_iteration = 0
10 | self.lower_bound_solution = []
11 | self.upper_bound_solution = []
12 | self.feasible_solution = []
13 | self.lower_bound_value = 0
14 | self.upper_bound_value = float('inf')
15 | self.repeated_nodes = []
16 | self.unserved_nodes = []
17 | self.served_time_dict = {}
18 |
19 |
20 |
21 | class ADMM():
22 | def __init__(self, Iteration_limit):
23 | self.priority_queue = []
24 | self.incumbent = float('inf')
25 | self.incumbent_node_id = -1
26 | self.path_dict = {}
27 | self.number_of_paths = 0
28 | self.iteration_limit = Iteration_limit
29 | self.time_limit_reached = False
30 | self.obj_value = float('inf')
31 | self.Lagrangian_price = {}
32 | self.lower_bound = 0
33 | self.upper_bound = float('inf')
34 | self.admm_itr_list = []
35 |
36 | def check_feasibility(self,served_time_dict):
37 | repeated_nodes = []
38 | unserved_nodes = []
39 | for i in served_time_dict:
40 | if served_time_dict[i] > 1:
41 | repeated_nodes.append(i)
42 | if served_time_dict[i] == 0:
43 | unserved_nodes.append(i)
44 | return repeated_nodes,unserved_nodes
45 |
46 | def g_served_time_for_each_node(self):
47 | served_time_dict = {}
48 | return served_time_dict
49 |
50 |
51 | def g_feasible_solution_based_on_upper_bound(self,current_solution):
52 |
53 | pass
54 |
55 | def update_Lagrangian_price(self,instanceVRP,served_time_dict):
56 | # repeated_nodes,unserved_nodes = self.check_feasibility()
57 | # served_time_dict = self.g_served_time_for_each_node()
58 | for i in instanceVRP.g_node_dict:
59 | if i != 1:
60 | instanceVRP.g_node_dict[i].dual_price += (1-served_time_dict[i]) * instanceVRP.rho
61 | instanceVRP.g_node_dict[i].ADMM_price = instanceVRP.g_node_dict[i].dual_price
62 |
63 |
64 | def update_rho(self,itr,admm_itr,instanceVRP,served_time_dict):
65 | admm_itr.repeated_nodes, admm_itr.unserved_nodes = self.check_feasibility(served_time_dict)
66 | try:
67 | previous_admm_itr = self.admm_itr_list[itr-1]
68 | if np.square(len(admm_itr.repeated_nodes)+len(admm_itr.unserved_nodes)) > 0.25*np.square(len(previous_admm_itr.repeated_nodes)+len(previous_admm_itr.unserved_nodes)):
69 | instanceVRP.rho=instanceVRP.rho * 2
70 | if np.square(len(admm_itr.repeated_nodes)+len(admm_itr.unserved_nodes))==0:
71 | instanceVRP.rho = instanceVRP.rho / 2
72 | except:
73 | pass
74 | def update_served_time_dict_and_ADMM_price_by_removing_one_block(self,v,instanceVRP,served_time_dict,g_node_dict,path_list_for_last_iteration):
75 | if path_list_for_last_iteration != []:
76 | path_to_remove = path_list_for_last_iteration[v][0]
77 | for i in path_to_remove[1:-1]:
78 | served_time_dict[i] -= 1
79 | for i in served_time_dict:
80 | g_node_dict[i].ADMM_price = g_node_dict[i].dual_price+( 1-2*served_time_dict[i]) *instanceVRP.rho / 2
81 |
82 | def update_served_time_dict_and_ADMM_price_by_adding_one_block(self,served_time_dict,path):
83 | for i in path[1:-1]:
84 | served_time_dict[i] += 1
85 |
86 | def update_ADMM_price_during_one_iteration(self,v,instanceVRP,served_time_dict,g_node_dict,path_list_for_last_iteration,path):
87 | path_to_add = path
88 | for i in path_to_add[1:-1]:
89 | served_time_dict[i] += 1
90 | if path_list_for_last_iteration != []:
91 | path_to_remove = path_list_for_last_iteration[v][0]
92 | for i in served_time_dict:
93 | if i in path_to_remove:
94 | served_time_dict[i] -= 1
95 | for i in served_time_dict:
96 | g_node_dict[i].ADMM_price += ( 1-2*served_time_dict[i]) *instanceVRP.rho / 2
97 | return served_time_dict
98 | def calculate_upper_bound(self,upper_bound_solution):
99 | upper_bound = 0
100 | for p in upper_bound_solution:
101 | upper_bound += p[2]
102 | return upper_bound
103 | # self.g_feasible_solution_based_on_upper_bound(upper_bound_solution)
104 |
105 | def calculate_lower_bound(self,lower_bound_solution,g_node_dict):
106 | path_cost = lower_bound_solution[0][1]
107 | local_lower_bound = path_cost * number_of_used_vehicle + [i.dual_price for i in g_node_dict]
108 | return local_lower_bound
109 |
110 | def conductADMM(self,instanceVRP):
111 | path = [[]]
112 | thenetwork = Network(instanceVRP.g_node_dict,instanceVRP.g_link_dict)
113 | thenetwork.g_node_Ngset(len(instanceVRP.g_node_dict),instanceVRP.g_node_dict,instanceVRP.g_link_dict)
114 | served_time_dict = dict.fromkeys(range(2,len(instanceVRP.g_node_dict)+1), 0)
115 | print(served_time_dict)
116 | for itr in range(self.iteration_limit):
117 | print("iteration=", (itr + 1))
118 | admm_itr = ADMM_ITER()
119 | try:
120 | previous_admm_itr = self.admm_itr_list[-1]
121 | except:
122 | previous_admm_itr = ADMM_ITER()
123 | # served_time_dict = {}
124 | # for i in instanceVRP.g_node_dict:
125 | # if i !=thenetwork.origin and i != thenetwork.destination:
126 | # served_time_dict[i] = 0
127 | admm_itr.number_of_iteration = itr
128 | lb_path,lb_path_cost,lb_path_primal_cost = DSSR_ng_route.DSSR_ng_Route_Algorithm(thenetwork,instanceVRP.veh_cap,instanceVRP.g_node_dict,instanceVRP.g_link_dict,completion_bound_flag=1,ADMM_flag=1) #for lower bound
129 | admm_itr.lower_bound_solution.append([lb_path[0],lb_path_cost[0]])
130 | for v in range(instanceVRP.number_of_vehicles):
131 | self.update_served_time_dict_and_ADMM_price_by_removing_one_block(v,instanceVRP,served_time_dict,instanceVRP.g_node_dict,previous_admm_itr.upper_bound_solution)
132 | path, path_dual_cost,path_primal_cost = DSSR_ng_route.DSSR_ng_Route_Algorithm(thenetwork, instanceVRP.veh_cap, instanceVRP.g_node_dict,instanceVRP.g_link_dict, completion_bound_flag=1,ADMM_flag=1)
133 | self.update_served_time_dict_and_ADMM_price_by_adding_one_block(served_time_dict,path[0])
134 |
135 | admm_itr.upper_bound_solution.append([path[0], path_dual_cost[0],path_primal_cost[0]])
136 | admm_itr.upper_bound_value = self.calculate_upper_bound(admm_itr.upper_bound_solution)
137 | # admm_itr.lower_bound_value = self.calculate_lower_bound(admm_itr.lower_bound_solution,instanceVRP.g_node_dict)
138 | self.update_Lagrangian_price(instanceVRP,served_time_dict)
139 | # self.update_rho(itr,admm_itr,instanceVRP,served_time_dict)
140 | admm_itr.served_time_dict = copy.copy(served_time_dict)
141 | self.admm_itr_list.append(admm_itr)
142 | print(admm_itr.upper_bound_solution)
143 |
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/.idea/ADMM Solomon C101.100.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/C101_100_ADMM.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import time
3 | import copy
4 | import pandas as pd
5 | import matplotlib.pyplot as plt
6 |
7 |
8 | class Node:
9 | """
10 | class name: Node
11 | represents physical nodes in the vehicle routing system
12 | including the origin node (depot, type=1), the destination node (depot, type=1), and the customers (type=2)
13 | """
14 |
15 | def __init__(self):
16 | """
17 | attributes of the Node object
18 | """
19 | self.node_id = 0
20 | self.x = 0.0
21 | self.y = 0.0
22 | self.type = 0
23 | self.outgoing_node_id_list = []
24 | self.outgoing_node_size = 0
25 | self.outgoing_link_obj_list = []
26 | self.demand = 0.0
27 | self.activity_beginning_time = 0
28 | self.activity_ending_time = 0
29 | self.service_time = 0
30 | self.base_profit_for_admm = 0
31 | self.base_profit_for_lr = 0
32 |
33 |
34 | class Link:
35 | """
36 | class name: Link
37 | represents the physical links in the vehicle routing system
38 | the nodes incident to a link can be any physical node, including customers, origin depot, and destination depot
39 | """
40 |
41 | def __init__(self):
42 | """
43 | attributes of the Link object
44 | """
45 | self.link_id = 0
46 | self.from_node_id = 0
47 | self.to_node_id = 0
48 | # Q: how to compute the distance of a link?
49 | # A: ((customer1['x_coord'] - customer2['x_coord']) ** 2 + (customer1['y_coord'] - customer2['y_coord']) ** 2) ** 0.5
50 | self.distance = 0.0
51 | self.spend_tm = 1.0
52 |
53 |
54 | class Agent:
55 | """
56 | class name: Agent
57 | An Agent object represents a vehicle, which is a decision maker to carry out the logistics transportation missions
58 | """
59 |
60 | def __init__(self):
61 | """
62 | attributes of the Agent object
63 | """
64 | self.agent_id = 0
65 | self.from_node_id = 0
66 | self.to_node_id = 0
67 | self.departure_time_beginning = 0
68 | self.arrival_time_ending = 0
69 | self.capacity = 0
70 |
71 |
72 | class VSState:
73 | """
74 | class Name: VSState
75 | class for Vehicle Scheduling State
76 | member functions:
77 | __init__(): generate an VSState object
78 | my_copy(): given a VSState object, we can load the information from that VSState object through this function
79 | calculate_label_cost: calculate the label cost of the VSState object, it is used for label updating, objective function computation, and bound value finding
80 | generate_string_key: generate the string key of the VSState object
81 | """
82 |
83 | def __init__(self):
84 | self.current_node_id = 0
85 | self.m_visit_node_sequence = []
86 | self.m_visit_time_sequence = []
87 | self.m_used_vehicle_capacity = 0
88 |
89 | self.passenger_service_state = [0] * g_number_of_nodes
90 | self.passenger_vehicle_visit_allowed_flag = [1] * g_number_of_nodes
91 |
92 | self.label_cost_for_admm = 0
93 | self.label_cost_for_lr = 0
94 | self.primal_label_cost = 0
95 |
96 | self.total_travel_cost = 0
97 | self.total_waiting_cost = 0
98 | self.total_fixed_cost = 0
99 |
100 | def my_copy(self, current_element):
101 | self.current_node_id = current_element.current_node_id
102 | self.m_visit_node_sequence = copy.copy(current_element.m_visit_node_sequence)
103 | self.m_visit_time_sequence = copy.copy(current_element.m_visit_time_sequence)
104 | self.m_used_vehicle_capacity = current_element.m_used_vehicle_capacity
105 |
106 | self.passenger_service_state = copy.copy(current_element.passenger_service_state)
107 | self.passenger_vehicle_visit_allowed_flag = copy.copy(current_element.passenger_vehicle_visit_allowed_flag)
108 |
109 | self.label_cost_for_admm = current_element.label_cost_for_admm
110 | self.label_cost_for_lr = current_element.label_cost_for_lr
111 | self.primal_label_cost = current_element.primal_label_cost # primal label cost is USED to compute the objective function value to the PRIMAL problem (namely, the upper bound value)
112 |
113 | self.total_travel_cost = current_element.total_travel_cost
114 | self.total_waiting_cost = current_element.total_waiting_cost
115 | self.total_fixed_cost = current_element.total_fixed_cost
116 |
117 | def calculate_label_cost(self):
118 | # fixed cost
119 | if from_node_id == 0 and to_node_id != g_number_of_nodes - 1:
120 | self.label_cost_for_admm += fixed_cost
121 | self.label_cost_for_lr += fixed_cost
122 | self.primal_label_cost += fixed_cost
123 | self.total_fixed_cost += fixed_cost
124 |
125 | # transportation cost
126 | self.label_cost_for_admm = self.label_cost_for_admm - g_node_list[to_node_id].base_profit_for_admm + link_obj.distance
127 | self.label_cost_for_lr = self.label_cost_for_lr - g_node_list[to_node_id].base_profit_for_lr + link_obj.distance
128 | self.primal_label_cost = self.primal_label_cost + link_obj.distance
129 | self.total_travel_cost = self.total_travel_cost + link_obj.distance
130 |
131 | # waiting cost
132 | if from_node_id != 0 and waiting_cost_flag == 1:
133 | self.label_cost_for_admm += (g_node_list[to_node_id].activity_beginning_time - next_time) * waiting_arc_cost
134 | self.label_cost_for_lr += (g_node_list[to_node_id].activity_beginning_time - next_time) * waiting_arc_cost
135 | self.primal_label_cost += (g_node_list[to_node_id].activity_beginning_time - next_time) * waiting_arc_cost
136 | self.total_waiting_cost += (g_node_list[to_node_id].activity_beginning_time - next_time) * waiting_arc_cost
137 |
138 | def generate_string_key(self):
139 | return self.current_node_id
140 |
141 |
142 | class TimeIndexedStateVector:
143 | """
144 | class Name: TimeIndexedStateVector
145 | vector recording states at different time instants
146 | VSState objects will be stored in the member variables of this class
147 | """
148 |
149 | def __init__(self):
150 | self.current_time = 0
151 | self.m_VSStateVector = []
152 | self.m_state_map = []
153 |
154 | def m_find_state_index(self, string_key):
155 | if string_key in self.m_state_map:
156 | return self.m_state_map.index(string_key)
157 | else:
158 | return -1
159 |
160 | def update_state(self, new_element, ul_flag):
161 |
162 | string_key = new_element.generate_string_key() # obtain the "string_key" of VSState object "new_element"
163 | state_index = self.m_find_state_index(string_key) # try to find the location of the "string_key" within "m_state_map" object
164 |
165 | if state_index == -1:
166 | self.m_VSStateVector.append(new_element) # just add the VSState object "new_element" into "m_VSStateVector"
167 | self.m_state_map.append(string_key) # add the "string_key" into "m_state_map"
168 | else: # (state_index != -1)
169 | if ul_flag == 0: # ADMM
170 | if new_element.label_cost_for_admm < self.m_VSStateVector[state_index].label_cost_for_admm:
171 | self.m_VSStateVector[state_index] = new_element
172 | else: # LR
173 | if new_element.label_cost_for_lr < self.m_VSStateVector[state_index].label_cost_for_lr:
174 | self.m_VSStateVector[state_index] = new_element
175 |
176 | def sort(self, ul_flag):
177 | if ul_flag == 0: # ADMM
178 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_admm)
179 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
180 | else: # LR
181 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_lr)
182 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
183 |
184 | def get_best_value(self):
185 | if len(self.m_VSStateVector) >= 1:
186 | return [self.m_VSStateVector[0].label_cost_for_admm, self.m_VSStateVector[0].label_cost_for_lr, self.m_VSStateVector[0].primal_label_cost]
187 |
188 |
189 | def read_input_data():
190 | # global variables
191 | global g_number_of_nodes
192 | global g_number_of_customers
193 | global g_number_of_links
194 | global g_number_of_agents
195 | global g_number_of_time_intervals
196 |
197 | # step 1: read information of NODEs
198 |
199 | # step 1.1: establish origin depot
200 | node = Node()
201 | node.node_id = 0
202 | node.type = 1
203 | node.x = 40.0
204 | node.y = 50.0
205 | node.activity_beginning_time = 0
206 | node.activity_ending_time = g_number_of_time_intervals
207 | g_node_list.append(node)
208 | g_number_of_nodes += 1
209 |
210 | # step 1.2: establish customers
211 | with open(r"./input/input_node.csv", "r") as fp:
212 | print('Read input_node.csv')
213 |
214 | reader = csv.DictReader(fp)
215 | for line in reader:
216 | node = Node()
217 |
218 | node.node_id = int(line['NO.'])
219 | node.type = 2
220 | node.x = float(line['XCOORD.'])
221 | node.y = float(line['YCOORD.'])
222 | node.demand = float(line['DEMAND'])
223 | node.activity_beginning_time = int(line['READYTIME'])
224 | node.activity_ending_time = int(line['DUEDATE'])
225 | node.service_time = int(line['SERVICETIME'])
226 |
227 | g_node_list.append(node)
228 | g_number_of_nodes += 1
229 | g_number_of_customers += 1
230 |
231 | print(f'The number of customers is {g_number_of_customers}')
232 |
233 | # step 1.3: establish destination depot
234 | node = Node()
235 | node.node_id = g_number_of_nodes
236 | node.type = 1
237 | node.x = 40.0
238 | node.y = 50.0
239 | node.activity_beginning_time = 0
240 | node.activity_ending_time = g_number_of_time_intervals
241 | g_node_list.append(node)
242 | g_number_of_nodes += 1
243 |
244 | print(f'the number of nodes is {g_number_of_nodes}')
245 |
246 | # step 2: read information of LINKs
247 | with open(r"./input/input_link.csv", "r") as fp:
248 | print('Read input_link.csv')
249 |
250 | reader = csv.DictReader(fp)
251 | for line in reader:
252 | link = Link()
253 |
254 | link.link_id = int(line['ID'])
255 | link.from_node_id = int(line['from_node'])
256 | link.to_node_id = int(line['to_node'])
257 | link.distance = float(line['distance'])
258 | link.spend_tm = int(line['spend_tm'])
259 |
260 | # establish the correlation with nodes and links
261 | g_node_list[link.from_node_id].outgoing_node_id_list.append(link.to_node_id) # add the ID of the tail Node object into the "outbound_node_list" of the head Node object
262 | g_node_list[link.from_node_id].outgoing_node_size = len(g_node_list[link.from_node_id].outgoing_node_id_list) # update the "outbound_node_size" of the head Node object
263 | g_node_list[link.from_node_id].outgoing_link_obj_list.append(link) # add the Link object into the "outbound_link_list" of the head node of the Link instance
264 |
265 | g_link_list.append(link)
266 | g_number_of_links += 1
267 |
268 | print(f'The number of links is {g_number_of_links}')
269 |
270 | # step 3: read information of AGENTs
271 | for i in range(g_number_of_agents):
272 | agent = Agent()
273 |
274 | agent.agent_id = i
275 | agent.from_node_id = 0
276 | agent.to_node_id = g_number_of_nodes - 1
277 | agent.departure_time_beginning = 0
278 | agent.arrival_time_ending = g_number_of_time_intervals
279 | agent.capacity = 200
280 |
281 | g_agent_list.append(agent)
282 |
283 | print(f'The number of agents is {g_number_of_agents}')
284 |
285 |
286 | def g_time_dependent_dynamic_programming(vehicle_id, origin_node, departure_time_beginning, destination_node, arrival_time_ending, beam_width, ul_flag):
287 | # :param ULFlag: 0 or 1, controls whether the dynamic programming is for ADMM algorithm or the pure Lagrangian relaxation
288 | # 0: ADMM (Upper Bound) ; 1: LR (Lower Bound)
289 |
290 | # global variables
291 | global g_ending_state_vector
292 | global waiting_cost_flag # 0: no need to wait; 1: need to wait
293 | global link_obj
294 | global from_node_id
295 | global to_node_id
296 | global next_time
297 |
298 | g_time_dependent_state_vector = [None] * (arrival_time_ending - departure_time_beginning + 1)
299 |
300 | if arrival_time_ending > g_number_of_time_intervals or g_node_list[origin_node].outgoing_node_size == 0:
301 | return MAX_LABEL_COST
302 |
303 | for t in range(departure_time_beginning, arrival_time_ending + 1):
304 | g_time_dependent_state_vector[t] = TimeIndexedStateVector()
305 | g_time_dependent_state_vector[t].current_time = t
306 |
307 | g_ending_state_vector[vehicle_id] = TimeIndexedStateVector()
308 |
309 | # origin node
310 | element = VSState()
311 | element.current_node_id = origin_node
312 | g_time_dependent_state_vector[departure_time_beginning].update_state(element, ul_flag)
313 |
314 | # start dynamic programming
315 | for t in range(departure_time_beginning, arrival_time_ending):
316 | g_time_dependent_state_vector[t].sort(ul_flag)
317 |
318 | for w in range(min(beam_width, len(g_time_dependent_state_vector[t].m_VSStateVector))):
319 | current_element = g_time_dependent_state_vector[t].m_VSStateVector[w]
320 | from_node_id = current_element.current_node_id
321 | from_node = g_node_list[from_node_id]
322 |
323 | for i in range(from_node.outgoing_node_size):
324 | to_node_id = from_node.outgoing_node_id_list[i]
325 | to_node = g_node_list[to_node_id]
326 | link_obj = from_node.outgoing_link_obj_list[i]
327 | next_time = t + link_obj.spend_tm
328 |
329 | # case i: to_node is the destination depot
330 | if to_node_id == destination_node:
331 | waiting_cost_flag = 0 # no need to wait
332 |
333 | new_element = VSState()
334 | new_element.my_copy(current_element)
335 |
336 | new_element.m_visit_node_sequence.append(to_node_id)
337 | new_element.m_visit_time_sequence.append(next_time)
338 |
339 | new_element.m_visit_node_sequence.append(to_node_id)
340 | new_element.m_visit_time_sequence.append(arrival_time_ending)
341 |
342 | new_element.calculate_label_cost()
343 |
344 | g_ending_state_vector[vehicle_id].update_state(new_element, ul_flag)
345 | continue
346 |
347 | # case ii: to_node is the origin depot
348 | if to_node_id == origin_node:
349 | continue
350 |
351 | # case iii: to_node is a customer
352 | if current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 0:
353 | # has been visited, no allow
354 | continue
355 | else: # current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 1
356 | # time window constraint
357 | if next_time > to_node.activity_ending_time:
358 | continue
359 | if next_time + to_node.service_time > arrival_time_ending:
360 | continue
361 |
362 | # capacity constraint
363 | if current_element.m_used_vehicle_capacity + to_node.demand > g_agent_list[vehicle_id].capacity:
364 | continue
365 |
366 | # check whether it is needed to wait
367 | if next_time < to_node.activity_beginning_time: # need to wait
368 | waiting_cost_flag = 1
369 |
370 | new_element = VSState()
371 | new_element.my_copy(current_element)
372 |
373 | new_element.current_node_id = to_node_id
374 | new_element.passenger_service_state[to_node_id] = 1 # change the entry of "passenger_service_state" to note that the "to_node" has been visited
375 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0 # change the corresponding flag of "passenger_vehicle_visit_allowed_flag" to note that the vehicle "vehicle_id" can not visit this "to_node" again
376 |
377 | new_element.m_visit_node_sequence.append(to_node_id)
378 | new_element.m_visit_time_sequence.append(next_time)
379 |
380 | new_element.m_used_vehicle_capacity += to_node.demand
381 |
382 | new_element.m_visit_node_sequence.append(to_node_id)
383 | new_element.m_visit_time_sequence.append(to_node.activity_beginning_time)
384 |
385 | new_element.calculate_label_cost()
386 |
387 | new_element.m_visit_node_sequence.append(to_node_id)
388 | new_element.m_visit_time_sequence.append(to_node.activity_beginning_time + to_node.service_time)
389 |
390 | g_time_dependent_state_vector[to_node.activity_beginning_time + to_node.service_time].update_state(new_element, ul_flag)
391 | continue
392 | else: # do NOT need to wait
393 | waiting_cost_flag = 0
394 |
395 | new_element = VSState()
396 | new_element.my_copy(current_element)
397 |
398 | new_element.current_node_id = to_node_id
399 | new_element.passenger_service_state[to_node_id] = 1 # change the entry of "passenger_service_state" to note that the "to_node" has been visited
400 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0 # change the corresponding flag of "passenger_vehicle_visit_allowed_flag" to note that the vehicle "vehicle_id" can not visit this "to_node" again
401 |
402 | new_element.m_visit_node_sequence.append(to_node_id)
403 | new_element.m_visit_time_sequence.append(next_time)
404 |
405 | new_element.m_used_vehicle_capacity += to_node.demand
406 |
407 | new_element.calculate_label_cost()
408 |
409 | new_element.m_visit_node_sequence.append(to_node_id)
410 | new_element.m_visit_time_sequence.append(next_time + to_node.service_time)
411 |
412 | g_time_dependent_state_vector[next_time + to_node.service_time].update_state(new_element, ul_flag)
413 | continue
414 |
415 | g_ending_state_vector[vehicle_id].sort(ul_flag)
416 |
417 | return g_ending_state_vector[vehicle_id].get_best_value()
418 |
419 |
420 | def g_alternating_direction_method_of_multipliers():
421 | # global variables
422 | global admm_local_lower_bound
423 | global admm_local_upper_bound
424 |
425 | global admm_global_lower_bound
426 | global admm_global_upper_bound
427 |
428 | global glo_lb
429 | global glo_ub
430 |
431 | global beam_width
432 |
433 | global path_node_seq
434 | global path_time_seq
435 |
436 | global g_number_of_admm_iterations
437 |
438 | global g_number_of_agents
439 | global g_number_of_nodes
440 |
441 | global service_times
442 | global repeat_served
443 | global un_served
444 |
445 | global record_profit
446 |
447 | global rho
448 |
449 | path_node_seq = []
450 | path_time_seq = []
451 |
452 | service_times = []
453 | repeat_served = []
454 | un_served = []
455 |
456 | record_profit = []
457 |
458 | global_upper_bound = MAX_LABEL_COST
459 | global_lower_bound = -MAX_LABEL_COST
460 |
461 | for i in range(g_number_of_admm_iterations):
462 | print(f"=== Iteration number for the ADMM: {i} ===")
463 |
464 | number_of_used_vehicles = 0
465 |
466 | path_node_seq.append([])
467 | path_time_seq.append([])
468 |
469 | service_times.append([0] * g_number_of_nodes)
470 |
471 | repeat_served.append([])
472 | un_served.append([])
473 |
474 | record_profit.append([0] * g_number_of_nodes)
475 |
476 | if i > 0:
477 | service_times[i] = service_times[i - 1]
478 |
479 | for v in range(g_number_of_agents - 1):
480 | print(f"Dynamic programming for vehicle: {v}")
481 |
482 | # prepare mu^v_p
483 | if g_ending_state_vector[v] != None:
484 | for n in range(1, g_number_of_customers + 1):
485 | service_times[i][n] -= g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
486 |
487 | for n in range(1, g_number_of_customers + 1):
488 | g_node_list[n].base_profit_for_admm = g_node_list[n].base_profit_for_lr + (1 - 2 * service_times[i][n]) * rho / 2.0
489 |
490 | vehicle = g_agent_list[v]
491 | g_time_dependent_dynamic_programming(v, vehicle.from_node_id, vehicle.departure_time_beginning, vehicle.to_node_id, vehicle.arrival_time_ending, beam_width, 0)
492 |
493 | admm_local_upper_bound[i] += g_ending_state_vector[v].m_VSStateVector[0].primal_label_cost
494 | path_node_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_node_sequence)
495 | path_time_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_time_sequence)
496 |
497 | for n in range(1, g_number_of_customers + 1):
498 | service_times[i][n] += g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
499 |
500 | if len(path_node_seq[i][v]) != 2:
501 | number_of_used_vehicles += 1
502 |
503 | for n in range(1, g_number_of_customers + 1):
504 | if service_times[i][n] > 1:
505 | repeat_served[i].append(n)
506 | if service_times[i][n] == 0:
507 | un_served[i].append(n)
508 | admm_local_upper_bound[i] += 50
509 | # number_of_used_vehicles += 1
510 | record_profit[i].append(g_node_list[n].base_profit_for_lr)
511 |
512 | print(f"Number of used vehicles: {number_of_used_vehicles}")
513 |
514 | vehicle = g_agent_list[-1]
515 | g_time_dependent_dynamic_programming(vehicle.agent_id, vehicle.from_node_id, vehicle.departure_time_beginning, vehicle.to_node_id, vehicle.arrival_time_ending, beam_width, 1)
516 | admm_local_lower_bound[i] += g_number_of_agents * g_ending_state_vector[g_number_of_agents - 1].m_VSStateVector[0].label_cost_for_lr
517 |
518 | for n in range(1, g_number_of_customers + 1):
519 | admm_local_lower_bound[i] += g_node_list[n].base_profit_for_lr
520 | g_node_list[n].base_profit_for_lr += (1 - service_times[i][n]) * rho
521 |
522 | if glo_ub > admm_local_upper_bound[i]:
523 | glo_ub = admm_local_upper_bound[i]
524 | admm_global_upper_bound[i] = glo_ub
525 |
526 | if glo_lb < admm_local_lower_bound[i]:
527 | glo_lb = admm_local_lower_bound[i]
528 | admm_global_lower_bound[i] = glo_lb
529 |
530 |
531 | def output_data():
532 | # output path finding result
533 | f = open("./output/output_path.csv", "w")
534 | f.write("iteration,vehicle_id,path_node_seq,path_time_seq,\n")
535 | for i in range(g_number_of_admm_iterations):
536 | for v in range(g_number_of_agents - 1):
537 | f.write(str(i) + ",") # iteration number of admm: "i"
538 | f.write(str(v) + ",") # ID of the vehicle: "v"
539 | str1 = "" # string which records the sequence of nodes in the path
540 | str2 = "" # string which records the sequence of time instants in the path
541 | for s in range(len(path_node_seq[i][v])):
542 | str1 = str1 + str(path_node_seq[i][v][s]) + "_"
543 | str2 = str2 + str(path_time_seq[i][v][s]) + "_"
544 | f.write(str1 + "," + str2 + ",\n")
545 | f.close()
546 |
547 | # output the Lagrangian multipliers
548 | f = open("./output/output_profit.csv", "w")
549 | f.write("iteration,")
550 | for n in range(1, g_number_of_customers + 1):
551 | f.write(str(n) + ",")
552 | f.write("\n")
553 | for i in range(g_number_of_admm_iterations):
554 | f.write(str(i) + ",")
555 | for n in range(g_number_of_customers):
556 | f.write(str(record_profit[i][n]) + ",")
557 | f.write("\n")
558 | f.close()
559 |
560 | # output the gap information
561 | f = open("./output/output_gap.csv", "w")
562 | f.write("iteration,local_lower_bound,local_upper_bound,global_lower_bound,global_upper_bound,repeated_services,missed_services,\n")
563 | for i in range(g_number_of_admm_iterations):
564 | f.write(str(i) + ",") # write the current iteration number
565 | f.write(str(admm_local_lower_bound[i]) + ",") # write the local lower bound value for the current iteration
566 | f.write(str(admm_local_upper_bound[i]) + ",") # write the local upper bound value for the current iteration
567 | f.write(str(admm_global_lower_bound[i]) + ",") # write the global upper bound value for the current iteration
568 | f.write(str(admm_global_upper_bound[i]) + ",") # write the global upper bound value for the current iteration
569 | for j in repeat_served[i]:
570 | f.write(str(j) + "; ")
571 | f.write(",")
572 | for k in un_served[i]:
573 | f.write(str(k) + "; ")
574 | f.write(",\n")
575 | f.close()
576 |
577 | # plot
578 | gap_df = pd.read_csv("./output/output_gap.csv")
579 | iter_list = list(gap_df['iteration'])
580 | glo_LB_list = list(gap_df['global_lower_bound'])
581 | glo_UB_list = list(gap_df['global_upper_bound'])
582 | loc_LB_list = list(gap_df['local_lower_bound'])
583 | loc_UB_list = list(gap_df['local_upper_bound'])
584 |
585 | plt.rcParams['savefig.dpi'] = 300
586 | plt.rcParams['figure.dpi'] = 300
587 |
588 | plt.figure()
589 | plt.plot(iter_list, glo_LB_list, color='orange', linestyle='--')
590 | plt.plot(iter_list, glo_UB_list, color="red")
591 | plt.xlabel('Number of iterations', fontname="Times New Roman")
592 | plt.ylabel('Objective value', fontname="Times New Roman")
593 | plt.legend(labels=['Global lower bound', 'Global upper bound'], loc='best', prop={'family': 'Times New Roman'})
594 | plt.savefig("./output/fig_global_gap.svg")
595 | plt.show()
596 |
597 | plt.figure()
598 | plt.plot(iter_list, loc_LB_list, color='orange', linestyle='--')
599 | plt.plot(iter_list, loc_UB_list, color="red")
600 | plt.xlabel('Number of iterations', fontname="Times New Roman")
601 | plt.ylabel('Objective value', fontname="Times New Roman")
602 | plt.legend(labels=['Local lower bound', 'Local upper bound'], loc='best', prop={'family': 'Times New Roman'})
603 | plt.savefig("./output/fig_local_gap.svg")
604 | plt.show()
605 |
606 | # plot the path finding result (spatial)
607 | plt.figure()
608 | for v in range(g_number_of_agents - 1):
609 | x_coord = [40]
610 | y_coord = [50]
611 | for s in range(len(path_node_seq[g_number_of_admm_iterations - 1][v])):
612 | # obtain the Node object
613 | node_ID = path_node_seq[-1][v][s]
614 | x_coord.append(g_node_list[node_ID].x)
615 | y_coord.append(g_node_list[node_ID].y)
616 | x_coord.append(40)
617 | y_coord.append(50)
618 | plt.plot(x_coord, y_coord, linewidth=0.5)
619 |
620 | # plot the planar illustration
621 | plt.scatter(40, 50, marker='^')
622 | x_coord = []
623 | y_coord = []
624 | for n in g_node_list[1:-1]:
625 | x_coord.append(n.x)
626 | y_coord.append(n.y)
627 |
628 | plt.xlabel("Longitude", fontname="Times New Roman")
629 | plt.ylabel("Latitude", fontname="Times New Roman")
630 | plt.scatter(x_coord, y_coord)
631 |
632 | plt.savefig("./output/fig_path.svg")
633 | plt.show()
634 |
635 |
636 | if __name__ == "__main__":
637 | fixed_cost = 0
638 | waiting_arc_cost = 0
639 |
640 | g_number_of_nodes = 0
641 | g_number_of_customers = 0
642 | g_number_of_links = 0
643 | g_number_of_agents = 11 # this value is 11, the best-known solution utilizes 10 vehicles
644 | # 10 agents are used to compute the upper bound (Admm) , 1 agent is used to compute the lower bound (LR)
645 | g_number_of_time_intervals = 1236
646 | g_number_of_admm_iterations = 16
647 |
648 | MAX_LABEL_COST = 99999
649 |
650 | beam_width = 100
651 |
652 | rho = 1
653 |
654 | g_node_list = []
655 | g_link_list = []
656 | g_agent_list = []
657 |
658 | admm_local_lower_bound = [0] * g_number_of_admm_iterations # lower bound value of each iteration in the ADMM algorithm
659 | admm_local_upper_bound = [0] * g_number_of_admm_iterations # upper bound value of each iteration in the ADMM algorithm
660 |
661 | admm_global_lower_bound = [0] * g_number_of_admm_iterations # lower bound value of each iteration in the ADMM algorithm
662 | admm_global_upper_bound = [0] * g_number_of_admm_iterations # upper bound value of each iteration in the ADMM algorithm
663 |
664 | glo_lb = -99999
665 | glo_ub = 99999
666 |
667 | g_ending_state_vector = [None] * g_number_of_agents
668 |
669 | print("Reading data......")
670 | read_input_data()
671 | time_start = time.time()
672 |
673 | g_alternating_direction_method_of_multipliers()
674 |
675 | print(f'Processing time of ADMM: {time.time() - time_start: .2f} s')
676 |
677 | output_data()
678 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/README.md:
--------------------------------------------------------------------------------
1 | # Solomon C101.100
2 |
3 | C101.100 is a dataset of Vehicle Routing Problems with Time Windows (VRPTW), created by Solomon.
4 |
5 | The basic information of C101.100 is:
6 |
7 | Number of depots: 1
8 |
9 | Number of customers: 100
10 |
11 | Service time of each customer: 90
12 |
13 | Carrying capacity of vehicles: 200
14 |
15 | The time window of the depot is: [0, 1236]
16 |
17 | Customers are clusterly distributed in the area.
18 |
19 | # ADMM
20 |
21 | The full name of ADMM is alternating direction method of multipliers. This code implements ADMM method for solving the VRPTW problem from C101.100 dataset.
22 |
23 | # Solution result
24 |
25 | 
26 |
27 | Figure 1. The local bound value versus the number of iterations.
28 |
29 | 
30 |
31 | Figure 2. The global bound value versus the number of iterations.
32 |
33 | 
34 |
35 | Figure 3. The path finding results for each vehicle.
36 |
37 | # Main reference:
38 |
39 | Yao Y, Zhu X, Dong H, et al. ADMM-based problem decomposition scheme for vehicle routing problem with time windows[J]. Transportation Research Part B: Methodological, 2019, 129: 156-174.
40 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/input/input_node.csv:
--------------------------------------------------------------------------------
1 | NO.,XCOORD.,YCOORD.,DEMAND,READYTIME,DUEDATE,SERVICETIME
2 | 1,45,68,10,912,967,90
3 | 2,45,70,30,825,870,90
4 | 3,42,66,10,65,146,90
5 | 4,42,68,10,727,782,90
6 | 5,42,65,10,15,67,90
7 | 6,40,69,20,621,702,90
8 | 7,40,66,20,170,225,90
9 | 8,38,68,20,255,324,90
10 | 9,38,70,10,534,605,90
11 | 10,35,66,10,357,410,90
12 | 11,35,69,10,448,505,90
13 | 12,25,85,20,652,721,90
14 | 13,22,75,30,30,92,90
15 | 14,22,85,10,567,620,90
16 | 15,20,80,40,384,429,90
17 | 16,20,85,40,475,528,90
18 | 17,18,75,20,99,148,90
19 | 18,15,75,20,179,254,90
20 | 19,15,80,10,278,345,90
21 | 20,30,50,10,10,73,90
22 | 21,30,52,20,914,965,90
23 | 22,28,52,20,812,883,90
24 | 23,28,55,10,732,777,90
25 | 24,25,50,10,65,144,90
26 | 25,25,52,40,169,224,90
27 | 26,25,55,10,622,701,90
28 | 27,23,52,10,261,316,90
29 | 28,23,55,20,546,593,90
30 | 29,20,50,10,358,405,90
31 | 30,20,55,10,449,504,90
32 | 31,10,35,20,200,237,90
33 | 32,10,40,30,31,100,90
34 | 33,8,40,40,87,158,90
35 | 34,8,45,20,751,816,90
36 | 35,5,35,10,283,344,90
37 | 36,5,45,10,665,716,90
38 | 37,2,40,20,383,434,90
39 | 38,0,40,30,479,522,90
40 | 39,0,45,20,567,624,90
41 | 40,35,30,10,264,321,90
42 | 41,35,32,10,166,235,90
43 | 42,33,32,20,68,149,90
44 | 43,33,35,10,16,80,90
45 | 44,32,30,10,359,412,90
46 | 45,30,30,10,541,600,90
47 | 46,30,32,30,448,509,90
48 | 47,30,35,10,1054,1127,90
49 | 48,28,30,10,632,693,90
50 | 49,28,35,10,1001,1066,90
51 | 50,26,32,10,815,880,90
52 | 51,25,30,10,725,786,90
53 | 52,25,35,10,912,969,90
54 | 53,44,5,20,286,347,90
55 | 54,42,10,40,186,257,90
56 | 55,42,15,10,95,158,90
57 | 56,40,5,30,385,436,90
58 | 57,40,15,40,35,87,90
59 | 58,38,5,30,471,534,90
60 | 59,38,15,10,651,740,90
61 | 60,35,5,20,562,629,90
62 | 61,50,30,10,531,610,90
63 | 62,50,35,20,262,317,90
64 | 63,50,40,50,171,218,90
65 | 64,48,30,10,632,693,90
66 | 65,48,40,10,76,129,90
67 | 66,47,35,10,826,875,90
68 | 67,47,40,10,12,77,90
69 | 68,45,30,10,734,777,90
70 | 69,45,35,10,916,969,90
71 | 70,95,30,30,387,456,90
72 | 71,95,35,20,293,360,90
73 | 72,53,30,10,450,505,90
74 | 73,92,30,10,478,551,90
75 | 74,53,35,50,353,412,90
76 | 75,45,65,20,997,1068,90
77 | 76,90,35,10,203,260,90
78 | 77,88,30,10,574,643,90
79 | 78,88,35,20,109,170,90
80 | 79,87,30,10,668,731,90
81 | 80,85,25,10,769,820,90
82 | 81,85,35,30,47,124,90
83 | 82,75,55,20,369,420,90
84 | 83,72,55,10,265,338,90
85 | 84,70,58,20,458,523,90
86 | 85,68,60,30,555,612,90
87 | 86,66,55,10,173,238,90
88 | 87,65,55,20,85,144,90
89 | 88,65,60,30,645,708,90
90 | 89,63,58,10,737,802,90
91 | 90,60,55,10,20,84,90
92 | 91,60,60,10,836,889,90
93 | 92,67,85,20,368,441,90
94 | 93,65,85,40,475,518,90
95 | 94,65,82,10,285,336,90
96 | 95,62,80,30,196,239,90
97 | 96,60,80,10,95,156,90
98 | 97,60,85,30,561,622,90
99 | 98,58,75,20,30,84,90
100 | 99,55,80,10,743,820,90
101 | 100,55,85,20,647,726,90
102 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/output/output_gap.csv:
--------------------------------------------------------------------------------
1 | iteration,local_lower_bound,local_upper_bound,global_lower_bound,global_upper_bound,repeated_services,missed_services,
2 | 0,0.0,5000.0,0.0,5000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
3 | 1,100.0,5000.0,100.0,5000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
4 | 2,200.0,5000.0,200.0,5000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
5 | 3,300.0,5000.0,300.0,5000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
6 | 4,400.0,5000.0,400.0,5000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
7 | 5,453.8394933291451,2884.6322510654463,453.8394933291451,2884.6322510654463,,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
8 | 6,506.8394933291451,2884.6322510654463,506.8394933291451,2884.6322510654463,,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
9 | 7,559.8394933291452,2884.6322510654463,559.8394933291452,2884.6322510654463,,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
10 | 8,612.8394933291452,2460.701816388334,612.8394933291452,2460.701816388334,,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
11 | 9,655.8394933291452,2460.701816388334,655.8394933291452,2460.701816388334,,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
12 | 10,698.8394933291452,2107.405968391978,698.8394933291452,2107.405968391978,1; ,12; 13; 14; 15; 16; 17; 18; 19; 31; 32; 33; 34; 35; 36; 37; 38; 39; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; ,
13 | 11,731.8394933291452,1754.633131177045,731.8394933291452,1754.633131177045,1; ,12; 13; 14; 15; 16; 17; 18; 19; 53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; ,
14 | 12,755.8394933291452,1450.5178403078633,755.8394933291452,1450.5178403078633,1; ,53; 54; 55; 56; 57; 58; 59; 60; 70; 71; 73; 76; 77; 78; 79; 80; 81; ,
15 | 13,771.8394933291452,1505.6962559061806,771.8394933291452,1450.5178403078633,,70; 71; 73; 76; 77; 78; 79; 80; 81; 92; 93; 94; 95; 96; 97; 98; 99; 100; ,
16 | 14,788.7456720400833,829.6978883244196,788.7456720400833,829.6978883244196,1; ,,
17 | 15,788.8394933291452,828.9368669428338,788.8394933291452,828.9368669428338,,,
18 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/output/output_path.csv:
--------------------------------------------------------------------------------
1 | iteration,vehicle_id,path_node_seq,path_time_seq,
2 | 0,0,101_101_,0_1236_,
3 | 0,1,101_101_,0_1236_,
4 | 0,2,101_101_,0_1236_,
5 | 0,3,101_101_,0_1236_,
6 | 0,4,101_101_,0_1236_,
7 | 0,5,101_101_,0_1236_,
8 | 0,6,101_101_,0_1236_,
9 | 0,7,101_101_,0_1236_,
10 | 0,8,101_101_,0_1236_,
11 | 0,9,101_101_,0_1236_,
12 | 1,0,101_101_,0_1236_,
13 | 1,1,101_101_,0_1236_,
14 | 1,2,101_101_,0_1236_,
15 | 1,3,101_101_,0_1236_,
16 | 1,4,101_101_,0_1236_,
17 | 1,5,101_101_,0_1236_,
18 | 1,6,101_101_,0_1236_,
19 | 1,7,101_101_,0_1236_,
20 | 1,8,101_101_,0_1236_,
21 | 1,9,101_101_,0_1236_,
22 | 2,0,101_101_,0_1236_,
23 | 2,1,101_101_,0_1236_,
24 | 2,2,101_101_,0_1236_,
25 | 2,3,101_101_,0_1236_,
26 | 2,4,101_101_,0_1236_,
27 | 2,5,101_101_,0_1236_,
28 | 2,6,101_101_,0_1236_,
29 | 2,7,101_101_,0_1236_,
30 | 2,8,101_101_,0_1236_,
31 | 2,9,101_101_,0_1236_,
32 | 3,0,101_101_,0_1236_,
33 | 3,1,101_101_,0_1236_,
34 | 3,2,101_101_,0_1236_,
35 | 3,3,101_101_,0_1236_,
36 | 3,4,101_101_,0_1236_,
37 | 3,5,101_101_,0_1236_,
38 | 3,6,101_101_,0_1236_,
39 | 3,7,101_101_,0_1236_,
40 | 3,8,101_101_,0_1236_,
41 | 3,9,101_101_,0_1236_,
42 | 4,0,101_101_,0_1236_,
43 | 4,1,101_101_,0_1236_,
44 | 4,2,101_101_,0_1236_,
45 | 4,3,101_101_,0_1236_,
46 | 4,4,101_101_,0_1236_,
47 | 4,5,101_101_,0_1236_,
48 | 4,6,101_101_,0_1236_,
49 | 4,7,101_101_,0_1236_,
50 | 4,8,101_101_,0_1236_,
51 | 4,9,101_101_,0_1236_,
52 | 5,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
53 | 5,1,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
54 | 5,2,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
55 | 5,3,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
56 | 5,4,101_101_,0_1236_,
57 | 5,5,101_101_,0_1236_,
58 | 5,6,101_101_,0_1236_,
59 | 5,7,101_101_,0_1236_,
60 | 5,8,101_101_,0_1236_,
61 | 5,9,101_101_,0_1236_,
62 | 6,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
63 | 6,1,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
64 | 6,2,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
65 | 6,3,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
66 | 6,4,101_101_,0_1236_,
67 | 6,5,101_101_,0_1236_,
68 | 6,6,101_101_,0_1236_,
69 | 6,7,101_101_,0_1236_,
70 | 6,8,101_101_,0_1236_,
71 | 6,9,101_101_,0_1236_,
72 | 7,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
73 | 7,1,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
74 | 7,2,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
75 | 7,3,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
76 | 7,4,101_101_,0_1236_,
77 | 7,5,101_101_,0_1236_,
78 | 7,6,101_101_,0_1236_,
79 | 7,7,101_101_,0_1236_,
80 | 7,8,101_101_,0_1236_,
81 | 7,9,101_101_,0_1236_,
82 | 8,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
83 | 8,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
84 | 8,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
85 | 8,3,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
86 | 8,4,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
87 | 8,5,101_101_,0_1236_,
88 | 8,6,101_101_,0_1236_,
89 | 8,7,101_101_,0_1236_,
90 | 8,8,101_101_,0_1236_,
91 | 8,9,101_101_,0_1236_,
92 | 9,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
93 | 9,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
94 | 9,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
95 | 9,3,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
96 | 9,4,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
97 | 9,5,101_101_,0_1236_,
98 | 9,6,101_101_,0_1236_,
99 | 9,7,101_101_,0_1236_,
100 | 9,8,101_101_,0_1236_,
101 | 9,9,101_101_,0_1236_,
102 | 10,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
103 | 10,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
104 | 10,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
105 | 10,3,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
106 | 10,4,98_98_96_96_95_95_94_94_92_92_93_93_97_97_100_100_99_99_1_1_1_101_101_,30_120_125_215_217_307_310_400_403_493_495_585_590_680_685_775_780_870_885_912_1002_1020_1236_,
107 | 10,5,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
108 | 10,6,101_101_,0_1236_,
109 | 10,7,101_101_,0_1236_,
110 | 10,8,101_101_,0_1236_,
111 | 10,9,101_101_,0_1236_,
112 | 11,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
113 | 11,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
114 | 11,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
115 | 11,3,32_32_33_33_31_31_35_35_37_37_38_38_39_39_36_36_34_34_101_101_,31_121_123_213_218_308_313_403_408_498_500_590_595_685_690_780_783_873_905_1236_,
116 | 11,4,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
117 | 11,5,98_98_96_96_95_95_94_94_92_92_93_93_97_97_100_100_99_99_1_1_1_101_101_,30_120_125_215_217_307_310_400_403_493_495_585_590_680_685_775_780_870_885_912_1002_1020_1236_,
118 | 11,6,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
119 | 11,7,101_101_,0_1236_,
120 | 11,8,101_101_,0_1236_,
121 | 11,9,101_101_,0_1236_,
122 | 12,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
123 | 12,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
124 | 12,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
125 | 12,3,32_32_33_33_31_31_35_35_37_37_38_38_39_39_36_36_34_34_101_101_,31_121_123_213_218_308_313_403_408_498_500_590_595_685_690_780_783_873_905_1236_,
126 | 12,4,13_13_17_17_18_18_19_19_15_15_16_16_14_14_12_12_101_101_,30_120_124_214_217_307_312_402_407_497_502_592_594_684_687_777_815_1236_,
127 | 12,5,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
128 | 12,6,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
129 | 12,7,98_98_96_96_95_95_94_94_92_92_93_93_97_97_100_100_99_99_1_1_1_101_101_,30_120_125_215_217_307_310_400_403_493_495_585_590_680_685_775_780_870_885_912_1002_1020_1236_,
130 | 12,8,101_101_,0_1236_,
131 | 12,9,101_101_,0_1236_,
132 | 13,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
133 | 13,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
134 | 13,2,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
135 | 13,3,32_32_33_33_31_31_35_35_37_37_38_38_39_39_36_36_34_34_101_101_,31_121_123_213_218_308_313_403_408_498_500_590_595_685_690_780_783_873_905_1236_,
136 | 13,4,57_57_55_55_54_54_53_53_56_56_58_58_60_60_59_59_101_101_,35_125_127_217_222_312_317_407_411_501_503_593_596_686_696_786_821_1236_,
137 | 13,5,13_13_17_17_18_18_19_19_15_15_16_16_14_14_12_12_101_101_,30_120_124_214_217_307_312_402_407_497_502_592_594_684_687_777_815_1236_,
138 | 13,6,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
139 | 13,7,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
140 | 13,8,101_101_,0_1236_,
141 | 13,9,101_101_,0_1236_,
142 | 14,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
143 | 14,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
144 | 14,2,98_98_96_96_95_95_94_94_92_92_93_93_97_97_100_100_99_99_1_1_1_101_101_,30_120_125_215_217_307_310_400_403_493_495_585_590_680_685_775_780_870_885_912_1002_1020_1236_,
145 | 14,3,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
146 | 14,4,32_32_33_33_31_31_35_35_37_37_38_38_39_39_36_36_34_34_101_101_,31_121_123_213_218_308_313_403_408_498_500_590_595_685_690_780_783_873_905_1236_,
147 | 14,5,57_57_55_55_54_54_53_53_56_56_58_58_60_60_59_59_101_101_,35_125_127_217_222_312_317_407_411_501_503_593_596_686_696_786_821_1236_,
148 | 14,6,13_13_17_17_18_18_19_19_15_15_16_16_14_14_12_12_101_101_,30_120_124_214_217_307_312_402_407_497_502_592_594_684_687_777_815_1236_,
149 | 14,7,81_81_78_78_76_76_71_71_70_70_73_73_77_77_79_79_80_80_101_101_,47_137_140_230_232_322_327_417_422_512_515_605_609_699_700_790_795_885_936_1236_,
150 | 14,8,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
151 | 14,9,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
152 | 15,0,20_20_24_24_25_25_27_27_29_29_30_30_28_28_26_26_23_23_22_22_21_21_101_101_,10_100_105_195_197_287_289_379_382_472_477_567_570_660_662_752_755_845_848_938_940_1030_1040_1236_,
153 | 15,1,90_90_87_87_86_86_83_83_82_82_84_84_85_85_88_88_89_89_91_91_101_101_,20_110_115_205_206_296_302_392_395_485_490_580_582_672_675_765_767_857_860_950_972_1236_,
154 | 15,2,98_98_96_96_95_95_94_94_92_92_93_93_97_97_100_100_99_99_101_101_,30_120_125_215_217_307_310_400_403_493_495_585_590_680_685_775_780_870_903_1236_,
155 | 15,3,43_43_42_42_41_41_40_40_44_44_46_46_45_45_48_48_51_51_50_50_52_52_49_49_47_47_101_101_,16_106_109_199_201_291_293_383_386_476_478_568_570_660_662_752_755_845_847_937_940_1030_1033_1123_1125_1215_1233_1236_,
156 | 15,4,32_32_33_33_31_31_35_35_37_37_38_38_39_39_36_36_34_34_101_101_,31_121_123_213_218_308_313_403_408_498_500_590_595_685_690_780_783_873_905_1236_,
157 | 15,5,57_57_55_55_54_54_53_53_56_56_58_58_60_60_59_59_101_101_,35_125_127_217_222_312_317_407_411_501_503_593_596_686_696_786_821_1236_,
158 | 15,6,13_13_17_17_18_18_19_19_15_15_16_16_14_14_12_12_101_101_,30_120_124_214_217_307_312_402_407_497_502_592_594_684_687_777_815_1236_,
159 | 15,7,81_81_78_78_76_76_71_71_70_70_73_73_77_77_79_79_80_80_101_101_,47_137_140_230_232_322_327_417_422_512_515_605_609_699_700_790_795_885_936_1236_,
160 | 15,8,5_5_3_3_7_7_8_8_10_10_11_11_9_9_6_6_4_4_2_2_1_1_75_75_101_101_,15_105_106_196_198_288_290_380_383_473_476_566_569_659_661_751_753_843_846_936_938_1028_1031_1121_1136_1236_,
161 | 15,9,67_67_65_65_63_63_62_62_74_74_72_72_61_61_64_64_68_68_66_66_69_69_101_101_,12_102_103_193_195_285_290_380_383_473_478_568_571_661_663_753_756_846_851_941_943_1033_1048_1236_,
162 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon C101.100/output/output_profit.csv:
--------------------------------------------------------------------------------
1 | iteration,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,
2 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3 | 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4 | 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5 | 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
6 | 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7 | 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
8 | 6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
9 | 7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
10 | 8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
11 | 9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
12 | 10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
13 | 11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
14 | 12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
15 | 13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
16 | 14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
17 | 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
18 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/.idea/【ADMM】Solomon RC101.100.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/100-ADMM-for-solomonRc.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import copy
3 | import time
4 | import matplotlib.pyplot as plt
5 |
6 |
7 | class Node:
8 | def __init__(self):
9 | self.node_id = 0
10 | self.x = 0.0
11 | self.y = 0.0
12 | self.type = 0
13 | self.outgoing_node_id_list = []
14 | self.outbound_node_size = 0
15 | self.outgoing_link_obj_list = []
16 | self.demand = 0.0
17 | self.service_time = 0
18 | self.m_activity_node_beginning_time = 0
19 | self.m_activity_node_ending_time = 0
20 | self.base_profit_for_admm = 0
21 | self.base_profit_for_lr = 0
22 |
23 |
24 | class Link:
25 | def __init__(self):
26 | self.link_id = 0
27 | self.from_node_id = 0
28 | self.to_node_id = 0
29 | self.distance = 0.0
30 | self.spend_tm = 0
31 |
32 |
33 | class Agent:
34 | def __init__(self):
35 | self.agent_id = 0
36 | self.from_node_id = 0
37 | self.to_node_id = 0
38 | self.departure_time_beginning = 0.0
39 | self.arrival_time_beginning = 0.0
40 | self.capacity = 0
41 |
42 |
43 | def g_read_input_data():
44 | # initialization
45 | global g_number_of_agents
46 | global g_number_of_vehicles
47 | global g_number_of_customers
48 | global g_number_of_nodes
49 | global g_number_of_links
50 |
51 | # step 1: read information of NODEs
52 |
53 | # step 1.1: set the origin depot
54 | node = Node()
55 | node.node_id = 0
56 | node.type = 1
57 | node.x = 40.0
58 | node.y = 50.0
59 | node.m_activity_node_beginning_time = 0
60 | node.m_activity_node_ending_time = g_number_of_time_intervals
61 | g_node_list.append(node)
62 | g_number_of_nodes += 1
63 |
64 | with open("./input/input_node.csv", "r") as fp:
65 | print('read input_node.csv')
66 |
67 | reader = csv.DictReader(fp)
68 | for line in reader:
69 | node = Node()
70 | node.node_id = int(line["CUST NO."])
71 | node.type = 2
72 | node.x = float(line["XCOORD."])
73 | node.y = float(line["YCOORD."])
74 | node.demand = float(line["DEMAND"])
75 | node.m_activity_node_beginning_time = int(line["READY TIME"])
76 | node.m_activity_node_ending_time = int(line["DUE DATE"])
77 | node.service_time = int(line["SERVICE TIME"])
78 | node.base_profit_for_admm = base_profit
79 | node.base_profit_for_lr = base_profit
80 | g_node_list.append(node)
81 | g_number_of_nodes += 1
82 | g_number_of_customers += 1
83 |
84 | print(f'the number of customers is {g_number_of_customers}')
85 |
86 | # set the destination depot
87 | node = Node()
88 | node.type = 1
89 | node.node_id = g_number_of_nodes
90 | node.x = 40.0
91 | node.y = 50.0
92 | node.m_activity_node_beginning_time = 0
93 | node.m_activity_node_ending_time = g_number_of_time_intervals
94 | g_node_list.append(node)
95 | g_number_of_nodes += 1
96 | print(f'the number of nodes is {g_number_of_nodes}')
97 |
98 | # step 2: read information of LINKs
99 | with open("./input/input_link.csv", "r") as fp:
100 | print('read input_link.csv')
101 |
102 | reader = csv.DictReader(fp)
103 | for line in reader:
104 | link = Link()
105 | link.link_id = int(line["ID"])
106 | link.from_node_id = int(line["from_node"])
107 | link.to_node_id = int(line["to_node"])
108 | link.distance = float(line["distance"])
109 | link.spend_tm = int(line["spend_tm"])
110 |
111 | # make relationship between NODEs and LINKs
112 | g_node_list[link.from_node_id].outgoing_node_id_list.append(link.to_node_id)
113 | g_node_list[link.from_node_id].outbound_node_size = len(g_node_list[link.from_node_id].outgoing_node_id_list)
114 | g_node_list[link.from_node_id].outgoing_link_obj_list.append(link)
115 |
116 | g_link_list.append(link)
117 | g_number_of_links += 1
118 | print(f'the number of links is {g_number_of_links}')
119 |
120 | # step 3: read information of VEHICLEs
121 | for i in range(vehicle_fleet_size):
122 | agent = Agent()
123 | agent.agent_id = i
124 | agent.from_node_id = 0
125 | agent.to_node_id = g_number_of_nodes - 1
126 | agent.departure_time_beginning = 0
127 | agent.arrival_time_ending = g_number_of_time_intervals
128 | agent.capacity = 200
129 | g_agent_list.append(agent)
130 | g_number_of_vehicles += 1
131 |
132 | print(f'the number of vehicles is {g_number_of_vehicles}')
133 |
134 |
135 | class VSState:
136 | def __init__(self):
137 | self.current_node_id = 0
138 |
139 | self.m_visit_sequence = []
140 | self.m_visit_time_sequence = []
141 | self.m_vehicle_used_capacity = 0
142 |
143 | self.passenger_service_state = [0] * g_number_of_nodes
144 | self.passenger_vehicle_visit_allowed_flag = [1] * g_number_of_nodes
145 |
146 | self.label_cost_for_admm = 0 # with LR price and rho
147 | self.label_cost_for_lr = 0 # with LR price
148 | self.primal_label_cost = 0 # without LR price
149 |
150 | self.total_travel_cost = 0
151 | self.total_waiting_cost = 0
152 | self.total_fixed_cost = 0
153 |
154 | def my_copy(self, current_element):
155 | self.current_node_id = current_element.current_node_id
156 |
157 | self.m_visit_sequence = copy.copy(current_element.m_visit_sequence)
158 | self.m_visit_time_sequence = copy.copy(current_element.m_visit_time_sequence)
159 | self.m_vehicle_used_capacity = current_element.m_vehicle_used_capacity
160 |
161 | self.passenger_service_state = copy.copy(current_element.passenger_service_state)
162 | self.passenger_vehicle_visit_allowed_flag = copy.copy(current_element.passenger_vehicle_visit_allowed_flag)
163 |
164 | self.label_cost_for_admm = current_element.label_cost_for_admm
165 | self.label_cost_for_lr = current_element.label_cost_for_lr
166 | self.primal_label_cost = current_element.primal_label_cost
167 |
168 | self.total_travel_cost = current_element.total_travel_cost
169 | self.total_waiting_cost = current_element.total_waiting_cost
170 | self.total_fixed_cost = current_element.total_fixed_cost
171 |
172 | def calculate_label_cost(self):
173 | # fixed_cost
174 | if from_node_id == 0 and to_node_id != g_number_of_nodes - 1:
175 | self.label_cost_for_admm += fixed_cost
176 | self.label_cost_for_lr += fixed_cost
177 | self.primal_label_cost += fixed_cost
178 | self.total_fixed_cost += fixed_cost
179 |
180 | # transportation_cost
181 | self.label_cost_for_admm = self.label_cost_for_admm - g_node_list[to_node_id].base_profit_for_admm + link_obj.distance
182 | self.label_cost_for_lr = self.label_cost_for_lr - g_node_list[to_node_id].base_profit_for_lr + link_obj.distance
183 | self.primal_label_cost = self.primal_label_cost + link_obj.distance
184 | self.total_travel_cost += link_obj.distance
185 |
186 | # waiting_cost
187 | if from_node_id != 0 and waiting_cost_flag == 1:
188 | self.label_cost_for_admm += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
189 | self.label_cost_for_lr += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
190 | self.primal_label_cost += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
191 | self.total_waiting_cost += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
192 |
193 | def generate_string_key(self):
194 | return self.current_node_id
195 |
196 |
197 | class Time_Indexed_State_Vector:
198 | def __init__(self):
199 | self.current_time = 0
200 | self.m_VSStateVector = []
201 | self.m_state_map = []
202 |
203 | def m_find_state_index(self, string_key):
204 | if string_key in self.m_state_map:
205 | return self.m_state_map.index(string_key)
206 | else:
207 | return -1
208 |
209 | def update_state(self, new_element, ul_flag):
210 | string_key = new_element.generate_string_key()
211 | state_index = self.m_find_state_index(string_key)
212 | if state_index == -1:
213 | self.m_VSStateVector.append(new_element)
214 | self.m_state_map.append(string_key)
215 | else:
216 | if ul_flag == 0: # ADMM
217 | if new_element.label_cost_for_admm < self.m_VSStateVector[state_index].label_cost_for_admm:
218 | self.m_VSStateVector[state_index] = new_element
219 | else: # LR (ul_flag == 1)
220 | if new_element.label_cost_for_lr < self.m_VSStateVector[state_index].label_cost_for_lr:
221 | self.m_VSStateVector[state_index] = new_element
222 |
223 | def sort(self, ul_flag):
224 | if ul_flag == 0: # ADMM
225 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_admm)
226 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
227 |
228 | if ul_flag == 1: # LR
229 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_lr)
230 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
231 |
232 | def get_best_value(self):
233 | if len(self.m_VSStateVector) >= 1:
234 | return [self.m_VSStateVector[0].label_cost_for_lr, self.m_VSStateVector[0].primal_label_cost, self.m_VSStateVector[0].label_cost_for_admm]
235 |
236 |
237 | def g_time_dependent_dynamic_programming(vehicle_id,
238 | origin_node,
239 | departure_time_beginning,
240 | destination_node,
241 | arrival_time_ending,
242 | beam_width,
243 | ul_flag):
244 | global g_time_dependent_state_vector
245 | global g_ending_state_vector
246 | global link_obj
247 | global to_node_id
248 | global from_node_id
249 | global waiting_cost_flag
250 | global next_time
251 |
252 | g_time_dependent_state_vector = [None] * (arrival_time_ending - departure_time_beginning + 2)
253 |
254 | if arrival_time_ending > g_number_of_time_intervals or g_node_list[origin_node].outbound_node_size == 0:
255 | return MAX_LABEL_COST
256 |
257 | for t in range(departure_time_beginning, arrival_time_ending + 1):
258 | g_time_dependent_state_vector[t] = Time_Indexed_State_Vector()
259 | g_time_dependent_state_vector[t].current_time = t
260 |
261 | g_ending_state_vector[vehicle_id] = Time_Indexed_State_Vector()
262 |
263 | # origin_node
264 | element = VSState()
265 | element.current_node_id = origin_node
266 | g_time_dependent_state_vector[departure_time_beginning].update_state(element, ul_flag)
267 |
268 | for t in range(departure_time_beginning, arrival_time_ending):
269 | g_time_dependent_state_vector[t].sort(ul_flag)
270 | for w_index in range(min(beam_width, len(g_time_dependent_state_vector[t].m_VSStateVector))):
271 | current_element = g_time_dependent_state_vector[t].m_VSStateVector[w_index] # current_element is an example of VSState
272 | from_node_id = current_element.current_node_id
273 | from_node = g_node_list[from_node_id]
274 |
275 | for i in range(from_node.outbound_node_size):
276 | to_node_id = from_node.outgoing_node_id_list[i]
277 | to_node = g_node_list[to_node_id]
278 | link_obj = from_node.outgoing_link_obj_list[i]
279 | next_time = t + link_obj.spend_tm
280 |
281 | # case 1: to_node is the destination depot
282 | if to_node_id == destination_node:
283 | waiting_cost_flag = 0
284 | new_element = VSState()
285 | new_element.my_copy(current_element)
286 | # wait
287 | new_element.m_visit_time_sequence.append(next_time)
288 | new_element.m_visit_sequence.append(to_node_id)
289 |
290 | new_element.m_visit_time_sequence.append(arrival_time_ending)
291 | new_element.m_visit_sequence.append(to_node_id)
292 | new_element.calculate_label_cost()
293 | g_ending_state_vector[vehicle_id].update_state(new_element, ul_flag)
294 | continue
295 |
296 | # case 2: to_node is the origin depot
297 | if to_node_id == origin_node:
298 | continue
299 |
300 | # case 3: to_node is a customer
301 | if current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 0:
302 | continue
303 | if current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 1:
304 | # time window constraint
305 | if next_time > to_node.m_activity_node_ending_time:
306 | continue
307 | if next_time + service_length > arrival_time_ending:
308 | continue
309 | # carrying capacity constraint
310 | if current_element.m_vehicle_used_capacity > g_agent_list[vehicle_id].capacity - to_node.demand:
311 | continue
312 |
313 | if next_time < to_node.m_activity_node_beginning_time: # need to wait
314 | waiting_cost_flag = 1
315 |
316 | new_element = VSState()
317 | new_element.my_copy(current_element)
318 | new_element.current_node_id = to_node_id
319 | new_element.passenger_service_state[to_node_id] = 1
320 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0
321 |
322 | new_element.m_visit_time_sequence.append(next_time)
323 | new_element.m_visit_sequence.append(to_node_id)
324 | new_element.m_vehicle_used_capacity += to_node.demand
325 |
326 | new_element.m_visit_time_sequence.append(to_node.m_activity_node_beginning_time)
327 | new_element.m_visit_sequence.append(to_node_id)
328 |
329 | new_element.calculate_label_cost()
330 |
331 | new_element.m_visit_time_sequence.append(to_node.m_activity_node_beginning_time + to_node.service_time)
332 | new_element.m_visit_sequence.append(to_node_id)
333 |
334 | g_time_dependent_state_vector[to_node.m_activity_node_beginning_time + to_node.service_time].update_state(new_element, ul_flag)
335 | continue
336 | else: # do not need to wait
337 | waiting_cost_flag = 0
338 | new_element = VSState()
339 | new_element.my_copy(current_element)
340 | new_element.current_node_id = to_node_id
341 | new_element.passenger_service_state[to_node_id] = 1
342 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0
343 |
344 | new_element.m_visit_time_sequence.append(next_time)
345 | new_element.m_visit_sequence.append(to_node_id)
346 | new_element.m_vehicle_used_capacity += to_node.demand
347 |
348 | new_element.calculate_label_cost()
349 |
350 | new_element.m_visit_time_sequence.append(next_time + to_node.service_time)
351 | new_element.m_visit_sequence.append(to_node_id)
352 |
353 | g_time_dependent_state_vector[next_time + to_node.service_time].update_state(new_element, ul_flag)
354 | continue
355 |
356 | g_ending_state_vector[vehicle_id].sort(ul_flag)
357 | return g_ending_state_vector[vehicle_id].get_best_value()
358 |
359 |
360 | def g_alternating_direction_method_of_multipliers():
361 | # global variables
362 | global gap_threshold
363 |
364 | global glo_ub
365 | global glo_lb
366 |
367 | global ADMM_local_lowerbound
368 | global ADMM_local_upperbound
369 |
370 | global ADMM_global_lowerbound
371 | global ADMM_global_upperbound
372 |
373 | global beam_width
374 | global g_ending_state_vector
375 | global base_profit
376 | global path_node_seq
377 | global path_time_seq
378 | global g_number_of_ADMM_iterations
379 |
380 | global service_times
381 | global repeat_served
382 | global un_served
383 |
384 | global record_profit
385 |
386 | global rho
387 |
388 | g_ending_state_vector = [None] * g_number_of_vehicles
389 |
390 | repeat_served = []
391 | un_served = []
392 |
393 | path_node_seq = []
394 | path_time_seq = []
395 | service_times = []
396 | record_profit = []
397 |
398 | # for updating rho
399 | key_iter = int(g_number_of_ADMM_iterations / 3)
400 | primal_slack_in_last_iter = 9999 # initial: a huge number
401 |
402 | # loop for each ADMM iteration
403 | for i in range(g_number_of_ADMM_iterations):
404 | print(f"=== ADMM iteration number = {i} ===")
405 |
406 | used_v = 0
407 |
408 | path_node_seq.append([])
409 | path_time_seq.append([])
410 | service_times.append([0] * g_number_of_nodes)
411 | record_profit.append([])
412 | repeat_served.append([])
413 | un_served.append([])
414 |
415 | if i != 0:
416 | service_times[i] = service_times[i - 1]
417 |
418 | # Calculate_upper_bound(i)
419 | for v in range(g_number_of_vehicles - 1):
420 |
421 | # prepare mu^v_p
422 | if g_ending_state_vector[v] != None:
423 | for n in range(1, g_number_of_customers + 1):
424 | service_times[i][n] -= g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
425 |
426 | # prepare the modified cost
427 | for n in range(1, g_number_of_customers + 1):
428 | g_node_list[n].base_profit_for_admm = g_node_list[n].base_profit_for_lr + (1 - 2 * service_times[i][n]) * rho / 2.0
429 |
430 | # call dynamic programming (augmented Lagrangian)
431 | g_time_dependent_dynamic_programming(v, origin_node, departure_time_beginning, destination_node, arrival_time_ending, beam_width, 0)
432 |
433 | ADMM_local_upperbound[i] += g_ending_state_vector[v].m_VSStateVector[0].primal_label_cost
434 | path_node_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_sequence)
435 | path_time_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_time_sequence)
436 |
437 | for n in range(1, g_number_of_customers + 1):
438 | service_times[i][n] += g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
439 |
440 | if len(path_node_seq[i][v]) != 2:
441 | used_v += 1
442 |
443 | primal_slack = 0
444 | for n in range(1, g_number_of_customers + 1):
445 | if service_times[i][n] > 1:
446 | repeat_served[i].append(n)
447 | primal_slack += (service_times[i][n] - 1) ** 2
448 | if service_times[i][n] == 0:
449 | un_served[i].append(n)
450 | primal_slack += 1
451 | ADMM_local_upperbound[i] = ADMM_local_upperbound[i] + 90
452 | # ADMM_local_upperbound[i] = ADMM_local_upperbound[i] + 500
453 | record_profit[i].append(g_node_list[n].base_profit_for_lr)
454 |
455 | # Calculate_lower_bound(i)
456 | g_time_dependent_dynamic_programming(g_number_of_vehicles - 1, origin_node, departure_time_beginning, destination_node, arrival_time_ending, beam_width, 1)
457 |
458 | for vv in range(used_v):
459 | ADMM_local_lowerbound[i] += g_ending_state_vector[g_number_of_vehicles - 1].m_VSStateVector[vv].label_cost_for_lr
460 | for n in range(1, g_number_of_nodes - 1):
461 | ADMM_local_lowerbound[i] += g_node_list[n].base_profit_for_lr
462 |
463 | # adaptive updating the quadratic penalty parameter : rho
464 | if i >= key_iter:
465 | if primal_slack > 0.25 * primal_slack_in_last_iter:
466 | rho += 1
467 | if primal_slack == 0:
468 | rho = 1
469 | primal_slack_in_last_iter = primal_slack
470 |
471 | # sub-gradient method for updating Lagrangian multipliers
472 | for n in range(1, g_number_of_customers + 1):
473 | g_node_list[n].base_profit_for_lr = g_node_list[n].base_profit_for_lr + (1 - service_times[i][n]) * rho
474 |
475 | # global bound
476 | if glo_ub > ADMM_local_upperbound[i]:
477 | glo_ub = ADMM_local_upperbound[i]
478 | if glo_lb < ADMM_local_lowerbound[i]:
479 | glo_lb = ADMM_local_lowerbound[i]
480 | ADMM_global_lowerbound[i] = glo_lb
481 | ADMM_global_upperbound[i] = glo_ub
482 |
483 | gap = (glo_ub - glo_lb) / glo_ub
484 | print(f"Gap value = {gap * 100} %")
485 | print(f"Global upper bound value = {glo_ub}")
486 | if gap < gap_threshold:
487 | print(f"Gap threshold satisfied, terminates! Iteration number: {i}")
488 | i += 1
489 | return i # terminate
490 |
491 | return g_number_of_ADMM_iterations
492 |
493 |
494 | def output_data(number_of_iteration):
495 | # step 1: output the path finding results
496 | f = open("./output/output_path.csv", "w")
497 | f.write("iteration, vehicle_id, path_node_seq, path_time_seq\n")
498 | for i in range(number_of_iteration):
499 | for v in range(g_number_of_vehicles - 1):
500 | f.write(str(i) + ",")
501 | f.write(str(v) + ",")
502 | str1 = ""
503 | str2 = ""
504 | for s in range(len(path_node_seq[i][v])):
505 | str1 = str1 + str(path_node_seq[i][v][s]) + "_"
506 | str2 = str2 + str(path_time_seq[i][v][s]) + "_"
507 | f.write(str1 + "," + str2 + "\n")
508 | f.close()
509 |
510 | # step 2: output the Lagrange multipliers
511 | f = open("./output/output_profit.csv", "w")
512 | f.write("iteration,")
513 | for n in range(1, g_number_of_customers + 1):
514 | f.write(str(n) + ",")
515 | f.write("\n")
516 | for i in range(number_of_iteration):
517 | f.write(str(i) + ",")
518 | for n in range(g_number_of_customers):
519 | f.write(str(record_profit[i][n]) + ",")
520 | f.write("\n")
521 | f.close()
522 |
523 | # step 3: output the gap information
524 | f = open("./output/output_gap.csv", "w")
525 | f.write("iteration,loc_LB,loc_UB,glo_LB,glo_UB,repeated_services,missed_services\n")
526 | for i in range(number_of_iteration):
527 | f.write(str(i) + ",")
528 | f.write(str(ADMM_local_lowerbound[i]) + ",")
529 | f.write(str(ADMM_local_upperbound[i]) + ",")
530 | f.write(str(ADMM_global_lowerbound[i]) + ",")
531 | f.write(str(ADMM_global_upperbound[i]) + ",")
532 | for j in repeat_served[i]:
533 | f.write(str(j) + "; ")
534 | f.write(",")
535 | for k in un_served[i]:
536 | f.write(str(k) + "; ")
537 | f.write("\n")
538 | f.close()
539 |
540 | # step 4: plot the global & local bound evolution curve
541 | iter_list = list(range(number_of_iteration))
542 | glob_LB_list = ADMM_global_lowerbound[:number_of_iteration]
543 | glob_UB_list = ADMM_global_upperbound[:number_of_iteration]
544 | loc_LB_list = ADMM_local_lowerbound[:number_of_iteration]
545 | loc_UB_list = ADMM_local_upperbound[:number_of_iteration]
546 |
547 | plt.rcParams['savefig.dpi'] = 300
548 | plt.rcParams['figure.dpi'] = 300
549 | f = plt.figure(figsize=(20, 10))
550 | ax = f.add_subplot(121)
551 | ax.plot(iter_list, glob_LB_list, color='orange', linestyle='--')
552 | ax.plot(iter_list, glob_UB_list, color="red")
553 | ax.set_xlabel('Number of iterations', fontname="Times New Roman")
554 | ax.set_ylabel('Objective value', fontname="Times New Roman")
555 | ax.legend(labels=['Global lower bound', 'Global upper bound'], loc='best', prop={'family': 'Times New Roman'})
556 |
557 | ax2 = f.add_subplot(122)
558 | ax2.plot(iter_list, loc_LB_list, color='orange', linestyle='--')
559 | ax2.plot(iter_list, loc_UB_list, color="red")
560 | ax2.set_xlabel('Number of iterations', fontname="Times New Roman")
561 | ax2.set_ylabel('Objective value', fontname="Times New Roman")
562 | ax2.legend(labels=['Local lower bound', 'Local upper bound'], loc='best', prop={'family': 'Times New Roman'})
563 | f.savefig("./output/fig_gap.svg")
564 |
565 | # step 5: plot the path finding results
566 | iter_no = ADMM_global_upperbound.index(glo_ub)
567 | f = plt.figure(figsize=(20, 10))
568 | ax = f.add_subplot(121)
569 | for v in range(g_number_of_vehicles - 1):
570 | x_coord = [40]
571 | y_coord = [50]
572 | for s in range(len(path_node_seq[iter_no][v])):
573 | node_id = path_node_seq[iter_no][v][s]
574 | x_coord.append(g_node_list[node_id].x)
575 | y_coord.append(g_node_list[node_id].y)
576 | x_coord.append(40)
577 | y_coord.append(50)
578 | ax.plot(x_coord, y_coord, linewidth=1)
579 | ax.scatter(40, 50, marker='^')
580 | for n in g_node_list[1:-1]:
581 | ax.scatter(n.x, n.y, color="r")
582 | ax.set_xlabel("Longitude", fontname="Times New Roman")
583 | ax.set_ylabel("Latitude", fontname="Times New Roman")
584 | ax.set_title("Solution obtained by ADMM")
585 |
586 | # http://sun.aei.polsl.pl/~zjc/best-solutions-solomon.html#RC101
587 | opt_path = [[0, 28, 33, 85, 89, 91, 101],
588 | [0, 65, 52, 99, 57, 86, 74, 101],
589 | [0, 69, 98, 88, 53, 78, 55, 68, 101],
590 | [0, 27, 29, 31, 30, 34, 26, 32, 93, 101],
591 | [0, 92, 95, 62, 67, 71, 94, 50, 80, 101],
592 | [0, 64, 90, 84, 56, 66, 101],
593 | [0, 72, 36, 38, 41, 40, 43, 37, 35, 101],
594 | [0, 14, 47, 12, 73, 79, 46, 4, 60, 101],
595 | [0, 63, 76, 51, 22, 49, 20, 24, 101],
596 | [0, 59, 75, 87, 97, 58, 77, 101],
597 | [0, 39, 42, 44, 61, 81, 54, 96, 101],
598 | [0, 83, 23, 21, 19, 18, 48, 25, 101],
599 | [0, 82, 11, 15, 16, 9, 10, 13, 17, 101],
600 | [0, 5, 45, 2, 7, 6, 8, 3, 1, 70, 100, 101]]
601 | ax2 = f.add_subplot(122)
602 | for v in range(14):
603 | x_coord = []
604 | y_coord = []
605 | for s in range(len(opt_path[v])):
606 | node_id = opt_path[v][s]
607 | x_coord.append(g_node_list[node_id].x)
608 | y_coord.append(g_node_list[node_id].y)
609 | ax2.plot(x_coord, y_coord, linewidth=1)
610 | ax2.scatter(40, 50, marker='^')
611 | for n in g_node_list[1:-1]:
612 | plt.scatter(n.x, n.y, color="r")
613 | ax2.set_xlabel("Longitude", fontname="Times New Roman")
614 | ax2.set_ylabel("Latitude", fontname="Times New Roman")
615 | ax2.set_title("Best-known solution")
616 | f.savefig("./output/fig_path.svg")
617 |
618 |
619 | if __name__ == '__main__':
620 | gap_threshold = 0.08 # 8 %
621 | MAX_LABEL_COST = 9999
622 |
623 | glo_ub = MAX_LABEL_COST
624 | glo_lb = -MAX_LABEL_COST
625 |
626 | g_number_of_ADMM_iterations = 150
627 | vehicle_fleet_size = 16
628 | fixed_cost = 0
629 | waiting_arc_cost = 0
630 | service_length = 10
631 | origin_node = 0
632 | departure_time_beginning = 0
633 | destination_node = 101
634 | arrival_time_ending = 240
635 | g_number_of_time_intervals = 240
636 |
637 | g_node_list = []
638 | g_link_list = []
639 | g_agent_list = []
640 |
641 | g_number_of_nodes = 0
642 | g_number_of_customers = 0
643 | g_number_of_links = 0
644 | g_number_of_agents = 0
645 | g_number_of_vehicles = 0
646 |
647 | base_profit = 0
648 | rho = 1
649 |
650 | g_ending_state_vector = [None] * g_number_of_vehicles
651 |
652 | path_node_seq = []
653 | path_time_seq = []
654 | service_times = []
655 | record_profit = []
656 |
657 | beam_width = 100
658 |
659 | ADMM_local_lowerbound = [0] * g_number_of_ADMM_iterations
660 | ADMM_local_upperbound = [0] * g_number_of_ADMM_iterations
661 |
662 | ADMM_global_lowerbound = [0] * g_number_of_ADMM_iterations
663 | ADMM_global_upperbound = [0] * g_number_of_ADMM_iterations
664 |
665 | # start
666 | print('Reading data......')
667 | g_read_input_data()
668 |
669 | time_start = time.time()
670 |
671 | number_of_iteration = g_alternating_direction_method_of_multipliers()
672 |
673 | print(f'processing time of admm: {time.time() - time_start:.2f} s')
674 | print(f"The optimal objective value is: {ADMM_global_upperbound[number_of_iteration - 1]}")
675 |
676 | output_data(number_of_iteration)
677 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/input/input_node.csv:
--------------------------------------------------------------------------------
1 | CUST NO.,XCOORD.,YCOORD.,DEMAND,READY TIME,DUE DATE,SERVICE TIME
2 | 1,25,85,20,145,175,10
3 | 2,22,75,30,50,80,10
4 | 3,22,85,10,109,139,10
5 | 4,20,80,40,141,171,10
6 | 5,20,85,20,41,71,10
7 | 6,18,75,20,95,125,10
8 | 7,15,75,20,79,109,10
9 | 8,15,80,10,91,121,10
10 | 9,10,35,20,91,121,10
11 | 10,10,40,30,119,149,10
12 | 11,8,40,40,59,89,10
13 | 12,8,45,20,64,94,10
14 | 13,5,35,10,142,172,10
15 | 14,5,45,10,35,65,10
16 | 15,2,40,20,58,88,10
17 | 16,0,40,20,72,102,10
18 | 17,0,45,20,149,179,10
19 | 18,44,5,20,87,117,10
20 | 19,42,10,40,72,102,10
21 | 20,42,15,10,122,152,10
22 | 21,40,5,10,67,97,10
23 | 22,40,15,40,92,122,10
24 | 23,38,5,30,65,95,10
25 | 24,38,15,10,148,178,10
26 | 25,35,5,20,154,184,10
27 | 26,95,30,30,115,145,10
28 | 27,95,35,20,62,92,10
29 | 28,92,30,10,62,92,10
30 | 29,90,35,10,67,97,10
31 | 30,88,30,10,74,104,10
32 | 31,88,35,20,61,91,10
33 | 32,87,30,10,131,161,10
34 | 33,85,25,10,51,81,10
35 | 34,85,35,30,111,141,10
36 | 35,67,85,20,139,169,10
37 | 36,65,85,40,43,73,10
38 | 37,65,82,10,124,154,10
39 | 38,62,80,30,75,105,10
40 | 39,60,80,10,37,67,10
41 | 40,60,85,30,85,115,10
42 | 41,58,75,20,92,122,10
43 | 42,55,80,10,33,63,10
44 | 43,55,85,20,128,158,10
45 | 44,55,82,10,64,94,10
46 | 45,20,82,10,37,67,10
47 | 46,18,80,10,113,143,10
48 | 47,2,45,10,45,75,10
49 | 48,42,5,10,151,181,10
50 | 49,42,12,10,104,134,10
51 | 50,72,35,30,116,146,10
52 | 51,55,20,19,83,113,10
53 | 52,25,30,3,52,82,10
54 | 53,20,50,5,91,121,10
55 | 54,55,60,16,139,169,10
56 | 55,30,60,16,140,170,10
57 | 56,50,35,19,130,160,10
58 | 57,30,25,23,96,126,10
59 | 58,15,10,20,152,182,10
60 | 59,10,20,19,42,72,10
61 | 60,15,60,17,155,185,10
62 | 61,45,65,9,66,96,10
63 | 62,65,35,3,52,82,10
64 | 63,65,20,6,39,69,10
65 | 64,45,30,17,53,83,10
66 | 65,35,40,16,11,41,10
67 | 66,41,37,16,133,163,10
68 | 67,64,42,9,70,100,10
69 | 68,40,60,21,144,174,10
70 | 69,31,52,27,41,71,10
71 | 70,35,69,23,180,210,10
72 | 71,65,55,14,65,95,10
73 | 72,63,65,8,30,60,10
74 | 73,2,60,5,77,107,10
75 | 74,20,20,8,141,171,10
76 | 75,5,5,16,74,104,10
77 | 76,60,12,31,75,105,10
78 | 77,23,3,7,150,180,10
79 | 78,8,56,27,90,120,10
80 | 79,6,68,30,89,119,10
81 | 80,47,47,13,192,222,10
82 | 81,49,58,10,86,116,10
83 | 82,27,43,9,42,72,10
84 | 83,37,31,14,35,65,10
85 | 84,57,29,18,96,126,10
86 | 85,63,23,2,87,117,10
87 | 86,21,24,28,87,117,10
88 | 87,12,24,13,90,120,10
89 | 88,24,58,19,67,97,10
90 | 89,67,5,25,144,174,10
91 | 90,37,47,6,86,116,10
92 | 91,49,42,13,167,197,10
93 | 92,53,43,14,14,44,10
94 | 93,61,52,3,178,208,10
95 | 94,57,48,23,95,125,10
96 | 95,56,37,6,34,64,10
97 | 96,55,54,26,132,162,10
98 | 97,4,18,35,120,150,10
99 | 98,26,52,9,46,76,10
100 | 99,26,35,15,77,107,10
101 | 100,31,67,3,180,210,10
102 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/output/log.txt:
--------------------------------------------------------------------------------
1 | C:\Users\wangguixia\anaconda3\python.exe "D:/【论文】ADMM-based problem decomposition scheme for the vehicle routing problem with time windows/ADMM_Python-master/SolomonDataset_v2/rc101-100/100-ADMM-for-solomonRc.py"
2 | Reading data......
3 | read input_node.csv
4 | the number of customers is 100
5 | the number of nodes is 102
6 | read input_link.csv
7 | the number of links is 10302
8 | the number of vehicles is 16
9 | === ADMM iteration number = 0 ===
10 | Gap value = 100.0 %
11 | Global upper bound value = 9000.0
12 | === ADMM iteration number = 1 ===
13 | Gap value = 98.88888888888889 %
14 | Global upper bound value = 9000.0
15 | === ADMM iteration number = 2 ===
16 | Gap value = 97.77777777777777 %
17 | Global upper bound value = 9000.0
18 | === ADMM iteration number = 3 ===
19 | Gap value = 96.66666666666667 %
20 | Global upper bound value = 9000.0
21 | === ADMM iteration number = 4 ===
22 | Gap value = 95.55555555555556 %
23 | Global upper bound value = 9000.0
24 | === ADMM iteration number = 5 ===
25 | Gap value = 94.44444444444444 %
26 | Global upper bound value = 9000.0
27 | === ADMM iteration number = 6 ===
28 | Gap value = 93.33333333333333 %
29 | Global upper bound value = 9000.0
30 | === ADMM iteration number = 7 ===
31 | Gap value = 92.22222222222223 %
32 | Global upper bound value = 9000.0
33 | === ADMM iteration number = 8 ===
34 | Gap value = 91.02986690272668 %
35 | Global upper bound value = 8918.485281374238
36 | === ADMM iteration number = 9 ===
37 | Gap value = 89.02105350226952 %
38 | Global upper bound value = 8191.173175581512
39 | === ADMM iteration number = 10 ===
40 | Gap value = 85.86767845213618 %
41 | Global upper bound value = 7004.929436039206
42 | === ADMM iteration number = 11 ===
43 | Gap value = 84.07576297592462 %
44 | Global upper bound value = 6662.950929014977
45 | === ADMM iteration number = 12 ===
46 | Gap value = 81.51662790771987 %
47 | Global upper bound value = 6096.455867291148
48 | === ADMM iteration number = 13 ===
49 | Gap value = 80.54524865628574 %
50 | Global upper bound value = 6080.207369359279
51 | === ADMM iteration number = 14 ===
52 | Gap value = 74.52871978053855 %
53 | Global upper bound value = 4840.932012326279
54 | === ADMM iteration number = 15 ===
55 | Gap value = 71.54644025712989 %
56 | Global upper bound value = 4469.53717415979
57 | === ADMM iteration number = 16 ===
58 | Gap value = 70.77534467452008 %
59 | Global upper bound value = 4469.53717415979
60 | === ADMM iteration number = 17 ===
61 | Gap value = 66.31395630837096 %
62 | Global upper bound value = 3986.173370698164
63 | === ADMM iteration number = 18 ===
64 | Gap value = 62.01591424009628 %
65 | Global upper bound value = 3585.2305380903726
66 | === ADMM iteration number = 19 ===
67 | Gap value = 61.456756701650626 %
68 | Global upper bound value = 3585.2305380903726
69 | === ADMM iteration number = 20 ===
70 | Gap value = 60.32625067992184 %
71 | Global upper bound value = 3526.976939422919
72 | === ADMM iteration number = 21 ===
73 | Gap value = 52.6080188911643 %
74 | Global upper bound value = 2982.821227826846
75 | === ADMM iteration number = 22 ===
76 | Gap value = 51.97963196969123 %
77 | Global upper bound value = 2982.821227826846
78 | === ADMM iteration number = 23 ===
79 | Gap value = 51.602099330725515 %
80 | Global upper bound value = 2982.821227826846
81 | === ADMM iteration number = 24 ===
82 | Gap value = 51.25034840971626 %
83 | Global upper bound value = 2982.821227826846
84 | === ADMM iteration number = 25 ===
85 | Gap value = 46.687610168804795 %
86 | Global upper bound value = 2756.9923627739845
87 | === ADMM iteration number = 26 ===
88 | Gap value = 46.38319653512297 %
89 | Global upper bound value = 2756.9923627739845
90 | === ADMM iteration number = 27 ===
91 | Gap value = 46.20473248015558 %
92 | Global upper bound value = 2756.9923627739845
93 | === ADMM iteration number = 28 ===
94 | Gap value = 45.85978049504875 %
95 | Global upper bound value = 2756.9923627739845
96 | === ADMM iteration number = 29 ===
97 | Gap value = 45.63536970801651 %
98 | Global upper bound value = 2756.9923627739845
99 | === ADMM iteration number = 30 ===
100 | Gap value = 45.63536970801651 %
101 | Global upper bound value = 2756.9923627739845
102 | === ADMM iteration number = 31 ===
103 | Gap value = 45.17054171226903 %
104 | Global upper bound value = 2756.9923627739845
105 | === ADMM iteration number = 32 ===
106 | Gap value = 45.17054171226903 %
107 | Global upper bound value = 2756.9923627739845
108 | === ADMM iteration number = 33 ===
109 | Gap value = 41.78739458445249 %
110 | Global upper bound value = 2596.7639942454084
111 | === ADMM iteration number = 34 ===
112 | Gap value = 41.30997418534658 %
113 | Global upper bound value = 2596.7639942454084
114 | === ADMM iteration number = 35 ===
115 | Gap value = 37.87849384832228 %
116 | Global upper bound value = 2453.3234188609504
117 | === ADMM iteration number = 36 ===
118 | Gap value = 37.365417396213054 %
119 | Global upper bound value = 2453.3234188609504
120 | === ADMM iteration number = 37 ===
121 | Gap value = 37.365417396213054 %
122 | Global upper bound value = 2453.3234188609504
123 | === ADMM iteration number = 38 ===
124 | Gap value = 37.365417396213054 %
125 | Global upper bound value = 2453.3234188609504
126 | === ADMM iteration number = 39 ===
127 | Gap value = 37.365417396213054 %
128 | Global upper bound value = 2453.3234188609504
129 | === ADMM iteration number = 40 ===
130 | Gap value = 37.253647387977686 %
131 | Global upper bound value = 2453.3234188609504
132 | === ADMM iteration number = 41 ===
133 | Gap value = 37.253647387977686 %
134 | Global upper bound value = 2453.3234188609504
135 | === ADMM iteration number = 42 ===
136 | Gap value = 37.253647387977686 %
137 | Global upper bound value = 2453.3234188609504
138 | === ADMM iteration number = 43 ===
139 | Gap value = 33.386862797261635 %
140 | Global upper bound value = 2318.2705590678715
141 | === ADMM iteration number = 44 ===
142 | Gap value = 33.386862797261635 %
143 | Global upper bound value = 2318.2705590678715
144 | === ADMM iteration number = 45 ===
145 | Gap value = 33.386862797261635 %
146 | Global upper bound value = 2318.2705590678715
147 | === ADMM iteration number = 46 ===
148 | Gap value = 33.386862797261635 %
149 | Global upper bound value = 2318.2705590678715
150 | === ADMM iteration number = 47 ===
151 | Gap value = 28.453322541831085 %
152 | Global upper bound value = 2162.6363170264585
153 | === ADMM iteration number = 48 ===
154 | Gap value = 28.453322541831085 %
155 | Global upper bound value = 2162.6363170264585
156 | === ADMM iteration number = 49 ===
157 | Gap value = 28.453322541831085 %
158 | Global upper bound value = 2162.6363170264585
159 | === ADMM iteration number = 50 ===
160 | Gap value = 28.453322541831085 %
161 | Global upper bound value = 2162.6363170264585
162 | === ADMM iteration number = 51 ===
163 | Gap value = 28.453322541831085 %
164 | Global upper bound value = 2162.6363170264585
165 | === ADMM iteration number = 52 ===
166 | Gap value = 28.453322541831085 %
167 | Global upper bound value = 2162.6363170264585
168 | === ADMM iteration number = 53 ===
169 | Gap value = 28.453322541831085 %
170 | Global upper bound value = 2162.6363170264585
171 | === ADMM iteration number = 54 ===
172 | Gap value = 28.453322541831085 %
173 | Global upper bound value = 2162.6363170264585
174 | === ADMM iteration number = 55 ===
175 | Gap value = 28.453322541831085 %
176 | Global upper bound value = 2162.6363170264585
177 | === ADMM iteration number = 56 ===
178 | Gap value = 28.453322541831085 %
179 | Global upper bound value = 2162.6363170264585
180 | === ADMM iteration number = 57 ===
181 | Gap value = 28.453322541831085 %
182 | Global upper bound value = 2162.6363170264585
183 | === ADMM iteration number = 58 ===
184 | Gap value = 28.453322541831085 %
185 | Global upper bound value = 2162.6363170264585
186 | === ADMM iteration number = 59 ===
187 | Gap value = 28.453322541831085 %
188 | Global upper bound value = 2162.6363170264585
189 | === ADMM iteration number = 60 ===
190 | Gap value = 28.453322541831085 %
191 | Global upper bound value = 2162.6363170264585
192 | === ADMM iteration number = 61 ===
193 | Gap value = 28.453322541831085 %
194 | Global upper bound value = 2162.6363170264585
195 | === ADMM iteration number = 62 ===
196 | Gap value = 28.453322541831085 %
197 | Global upper bound value = 2162.6363170264585
198 | === ADMM iteration number = 63 ===
199 | Gap value = 18.39458326651296 %
200 | Global upper bound value = 1896.0682908947226
201 | === ADMM iteration number = 64 ===
202 | Gap value = 18.39458326651296 %
203 | Global upper bound value = 1896.0682908947226
204 | === ADMM iteration number = 65 ===
205 | Gap value = 18.39458326651296 %
206 | Global upper bound value = 1896.0682908947226
207 | === ADMM iteration number = 66 ===
208 | Gap value = 18.39458326651296 %
209 | Global upper bound value = 1896.0682908947226
210 | === ADMM iteration number = 67 ===
211 | Gap value = 18.39458326651296 %
212 | Global upper bound value = 1896.0682908947226
213 | === ADMM iteration number = 68 ===
214 | Gap value = 18.39458326651296 %
215 | Global upper bound value = 1896.0682908947226
216 | === ADMM iteration number = 69 ===
217 | Gap value = 8.938877446642772 %
218 | Global upper bound value = 1699.1822491859873
219 | === ADMM iteration number = 70 ===
220 | Gap value = 7.664925726822877 %
221 | Global upper bound value = 1675.7385452015876
222 | Gap threshold satisfied, terminates! Iteration number: 70
223 | Gap value = 7.664925726822877 %
224 | processing time of admm: 562.88 s
225 | The optimal objective value is: 1675.7385452015876
226 |
227 | Process finished with exit code 0
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/output/output_gap.csv:
--------------------------------------------------------------------------------
1 | iteration,loc_LB,loc_UB,glo_LB,glo_UB,repeated_services,missed_services
2 | 0,0,9000.0,0,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
3 | 1,100,9000.0,100,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
4 | 2,200,9000.0,200,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
5 | 3,300,9000.0,300,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
6 | 4,400,9000.0,400,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
7 | 5,500,9000.0,500,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
8 | 6,600,9000.0,600,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
9 | 7,700,9000.0,700,9000.0,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
10 | 8,800.0,8918.485281374238,800.0,8918.485281374238,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100;
11 | 9,899.304520483545,8191.173175581512,899.304520483545,8191.173175581512,,1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 57; 58; 59; 60; 61; 62; 63; 64; 65; 67; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 82; 83; 84; 85; 86; 87; 89; 92; 93; 94; 95; 96; 97; 99; 100;
12 | 10,989.9591521020247,7004.929436039206,989.9591521020247,7004.929436039206,80; ,2; 3; 5; 7; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 47; 48; 49; 50; 51; 52; 53; 55; 57; 58; 59; 60; 61; 63; 66; 68; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 82; 84; 85; 86; 87; 89; 97; 99;
13 | 11,1061.0240987341772,6662.950929014977,1061.0240987341772,6662.950929014977,56; 65; 69; 80; 88; 91; 98; ,2; 3; 5; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 21; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 47; 48; 50; 52; 53; 54; 57; 58; 59; 60; 61; 63; 66; 67; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 86; 87; 89; 93; 94; 96; 97; 99;
14 | 12,1126.8306223930663,6096.455867291148,1126.8306223930663,6096.455867291148,54; 80; 96; ,5; 9; 10; 11; 12; 13; 14; 15; 16; 17; 22; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 43; 45; 47; 48; 50; 51; 52; 53; 55; 56; 57; 58; 59; 60; 61; 63; 64; 66; 69; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 82; 84; 85; 86; 87; 88; 89; 97; 98; 99;
15 | 13,1182.8892248910383,6080.207369359279,1182.8892248910383,6080.207369359279,65; 80; ,6; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 43; 47; 48; 49; 50; 52; 53; 57; 58; 59; 60; 61; 62; 63; 67; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 86; 87; 89; 92; 94; 95; 97; 99;
16 | 14,1233.0473580932403,4840.932012326279,1233.0473580932403,4840.932012326279,12; 14; 15; 47; 55; 65; 66; 68; 70; 80; 91; 92; 95; 100; ,3; 5; 9; 10; 13; 17; 18; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 48; 50; 58; 59; 61; 64; 72; 73; 74; 75; 76; 77; 79; 81; 87; 89; 93; 97;
17 | 15,1271.7424300793446,4469.53717415979,1271.7424300793446,4469.53717415979,65; 80; ,3; 5; 12; 18; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 37; 43; 44; 48; 50; 53; 58; 59; 60; 61; 62; 64; 67; 71; 72; 73; 74; 75; 76; 77; 78; 79; 81; 87; 89; 94; 97;
18 | 16,1306.2068337923934,5504.468479969071,1306.2068337923934,4469.53717415979,54; 96; 100; ,8; 9; 10; 11; 13; 17; 18; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 43; 48; 50; 51; 52; 53; 55; 56; 57; 58; 59; 61; 63; 64; 66; 69; 72; 73; 74; 75; 76; 77; 79; 81; 82; 84; 85; 86; 87; 88; 89; 91; 97; 98; 99;
19 | 17,1342.7841032774654,3986.173370698164,1342.7841032774654,3986.173370698164,9; 10; 13; 15; 16; 17; 57; 65; 66; 69; 80; 82; 92; 93; 99; ,7; 18; 19; 21; 23; 25; 26; 27; 32; 33; 36; 41; 48; 53; 58; 59; 60; 62; 64; 67; 71; 72; 73; 74; 75; 76; 77; 78; 79; 87; 89; 94; 97;
20 | 18,1361.8170422785047,3585.2305380903726,1361.8170422785047,3585.2305380903726,37; 38; 39; 40; 43; 54; 68; 70; 91; 92; 95; 96; 100; ,6; 12; 13; 22; 25; 26; 27; 32; 33; 48; 52; 57; 58; 59; 64; 73; 74; 75; 76; 77; 78; 79; 82; 86; 87; 89; 97; 99;
21 | 19,1381.8641291028925,3992.9814459203603,1381.8641291028925,3585.2305380903726,20; 49; 52; 53; 54; 57; 65; 69; 83; 88; 96; 98; 99; ,7; 10; 13; 15; 16; 17; 27; 33; 35; 36; 37; 39; 43; 50; 51; 56; 58; 59; 62; 63; 64; 67; 71; 73; 75; 76; 77; 79; 84; 85; 89; 94; 95;
22 | 20,1399.2839895236134,3526.976939422919,1399.2839895236134,3526.976939422919,66; 92; 93; 95; ,2; 11; 21; 23; 24; 27; 33; 41; 42; 44; 50; 54; 55; 58; 59; 61; 68; 73; 74; 75; 76; 77; 79; 81; 87; 89; 96; 97;
23 | 21,1413.61807280204,2982.821227826846,1413.61807280204,2982.821227826846,9; 11; 14; 47; 65; 68; 83; 92; 94; 96; 100; ,8; 18; 24; 27; 33; 35; 36; 39; 50; 53; 59; 60; 63; 73; 74; 75; 76; 78; 79; 89;
24 | 22,1432.3617312886263,3502.0557783088125,1432.3617312886263,2982.821227826846,35; 37; 38; 39; 40; 43; 51; 56; 65; 69; 80; 84; 91; 92; ,7; 11; 19; 25; 26; 27; 32; 33; 41; 52; 54; 55; 57; 58; 59; 62; 67; 68; 71; 73; 75; 77; 79; 89; 94; 96;
25 | 23,1443.6228549856705,4161.2848793207595,1443.6228549856705,2982.821227826846,52; 54; 68; 82; 86; 96; ,2; 12; 22; 24; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 37; 43; 44; 50; 51; 55; 56; 59; 63; 64; 72; 73; 74; 75; 76; 79; 80; 84; 85; 89; 91; 93;
26 | 24,1454.1149561266109,3004.616368384339,1454.1149561266109,2982.821227826846,9; 12; 14; 18; 19; 20; 47; 49; 65; 69; 83; 87; 92; 93; 97; ,6; 27; 33; 36; 41; 42; 50; 52; 55; 57; 59; 62; 67; 71; 73; 75; 79; 85; 89;
27 | 25,1469.8185160583462,2756.9923627739845,1469.8185160583462,2756.9923627739845,2; 4; 6; 7; 8; 15; 16; 28; 33; 34; 35; 37; 40; 41; 42; 46; 53; 66; 68; 70; 82; 92; 95; 100; ,18; 24; 51; 58; 59; 64; 73; 74; 75; 77; 79; 87; 89; 97;
28 | 26,1478.2111766901967,3427.1334922196174,1478.2111766901967,2756.9923627739845,11; 12; 14; 38; 40; 72; 80; 91; 96; ,8; 10; 13; 15; 16; 17; 19; 25; 26; 29; 31; 32; 53; 59; 63; 69; 70; 74; 75; 76; 78; 83; 88; 89; 98;
29 | 27,1483.1314170559447,3216.2495645786694,1483.1314170559447,2756.9923627739845,26; 29; 30; 31; 32; 34; 60; 64; 78; 82; 83; 93; ,7; 12; 21; 23; 27; 38; 41; 48; 50; 54; 57; 59; 63; 66; 72; 75; 76; 77; 89; 90; 99;
30 | 28,1492.641716940577,3200.3296785049615,1492.641716940577,2756.9923627739845,9; 11; 19; 21; 23; 38; 41; 48; 56; 58; 63; 66; 69; 72; 76; 82; 83; 84; 90; 95; ,2; 26; 28; 32; 33; 52; 59; 60; 62; 64; 67; 68; 71; 73; 75; 78; 79; 89; 93; 94;
31 | 29,1498.8287052002968,3066.7232032196653,1498.8287052002968,2756.9923627739845,28; 33; 34; 64; 73; 98; ,6; 11; 21; 23; 38; 41; 48; 52; 54; 58; 59; 63; 72; 75; 76; 77; 87; 89; 92; 97;
32 | 30,1497.6465546404133,3343.1635621589676,1498.8287052002968,2756.9923627739845,20; 22; 38; 41; 48; 49; 52; 54; 58; 68; 72; 77; 87; 92; 95; 96; 97; ,1; 3; 10; 13; 15; 16; 17; 19; 29; 31; 50; 59; 64; 73; 74; 75; 79; 80; 83; 85; 89; 91;
33 | 31,1511.6439775430904,3217.47712165572,1511.6439775430904,2756.9923627739845,29; 31; 34; 60; 78; 80; 91; ,5; 12; 20; 22; 25; 38; 41; 45; 49; 54; 58; 59; 63; 72; 75; 76; 77; 87; 89; 92; 96; 97;
34 | 32,1504.3232839179404,2772.9749260544004,1511.6439775430904,2756.9923627739845,1; 2; 3; 4; 5; 6; 9; 11; 19; 20; 22; 25; 38; 41; 45; 46; 49; 54; 72; 87; 92; 95; 96; 97; 100; ,29; 31; 50; 51; 53; 57; 59; 69; 75; 78; 80; 89; 91;
35 | 33,1509.0087868651162,2596.7639942454084,1511.6439775430904,2596.7639942454084,12; 14; 29; 31; 34; 51; 56; 58; 60; 69; 80; 82; 83; 84; 86; 91; 95; ,2; 20; 22; 25; 38; 41; 49; 59; 72; 75; 89; 90;
36 | 34,1524.0414585682554,3515.9021932214973,1524.0414585682554,2596.7639942454084,14; 20; 22; 25; 47; 49; 90; ,6; 11; 19; 29; 31; 40; 42; 44; 50; 58; 59; 63; 68; 74; 75; 76; 77; 80; 82; 83; 86; 87; 89; 91; 92; 97;
37 | 35,1522.4500835351625,2453.3234188609504,1524.0414585682554,2453.3234188609504,24; 40; 42; 44; 52; 58; 80; 82; 86; 87; 91; 92; 95; ,4; 8; 12; 26; 27; 32; 33; 51; 64; 75; 89;
38 | 36,1536.628883324512,2609.637431073567,1536.628883324512,2453.3234188609504,11; 27; 30; 34; 48; ,6; 35; 37; 42; 43; 44; 47; 63; 75; 76; 77; 78; 89; 97;
39 | 37,1534.8043422140001,3200.470822230907,1536.628883324512,2453.3234188609504,35; 37; 42; 43; 44; 53; 55; 68; 69; 87; 95; 97; 98; ,1; 3; 11; 20; 22; 25; 26; 27; 30; 32; 49; 52; 57; 60; 64; 65; 79; 80; 85; 89;
40 | 38,1531.2929052925324,3084.8382575909322,1536.628883324512,2453.3234188609504,1; 2; 3; 4; 6; 7; 8; 12; 20; 22; 25; 29; 31; 34; 49; 52; 56; 60; 64; 65; 66; 80; 84; 85; 100; ,21; 23; 40; 42; 44; 54; 55; 59; 62; 67; 68; 71; 74; 75; 89; 94; 96;
41 | 39,1533.227058633238,3139.698442020664,1536.628883324512,2453.3234188609504,40; 42; 44; 54; 68; 83; 96; ,7; 11; 20; 22; 25; 29; 31; 49; 50; 56; 60; 63; 66; 69; 79; 82; 84; 85; 88; 92;
42 | 40,1539.3709631118131,2483.341299611625,1539.3709631118131,2453.3234188609504,20; 21; 22; 23; 25; 49; 60; 73; 76; 79; 82; 92; ,2; 12; 28; 33; 40; 42; 44; 50; 52; 53;
43 | 41,1539.229515507953,2677.9158150840776,1539.3709631118131,2453.3234188609504,15; 16; 28; 33; 34; 53; 76; 91; ,4; 8; 20; 22; 25; 36; 38; 39; 49; 68; 73; 79; 100;
44 | 42,1537.920806565523,2604.523547618289,1539.3709631118131,2453.3234188609504,11; 20; 22; 25; 36; 39; 40; 49; 52; 55; 57; 65; 68; 73; 79; 99; ,6; 21; 23; 28; 33; 50; 51; 83; 89; 90; 91;
45 | 43,1544.272748242571,2318.2705590678715,1544.272748242571,2318.2705590678715,28; 33; 34; 38; 41; 42; 83; 90; ,1; 3; 12; 19; 48; 63; 65; 76; 89;
46 | 44,1543.5617778643345,2583.691295717236,1544.272748242571,2318.2705590678715,1; 2; 3; 4; 6; 8; 46; 51; 64; 65; 70; 76; 85; 91; 100; ,11; 20; 22; 25; 28; 33; 34; 38; 41; 42; 49;
47 | 45,1531.7034286646435,2638.818216671387,1544.272748242571,2318.2705590678715,11; 19; 20; 21; 23; 25; 28; 33; 34; 49; 63; 93; 95; ,2; 27; 36; 39; 40; 47; 51; 64; 78; 80; 89; 91;
48 | 46,1532.3202950384266,2664.9199459399947,1544.272748242571,2318.2705590678715,14; 27; 30; 36; 39; 40; 47; 51; 64; 69; 80; 91; ,4; 11; 20; 22; 25; 46; 49; 52; 63; 65; 95; 100;
49 | 47,1547.2944303361437,2162.6363170264585,1547.2944303361437,2162.6363170264585,20; 21; 22; 23; 25; 29; 31; 38; 41; 42; 49; 65; 95; ,8; 12; 51; 64; 70; 89;
50 | 48,1542.280569964011,2426.8095787429984,1547.2944303361437,2162.6363170264585,12; 40; 44; 64; 72; 76; ,6; 14; 21; 23; 24; 29; 31; 47; 50; 65;
51 | 49,1543.3970381209094,2764.5928890445757,1547.2944303361437,2162.6363170264585,29; 31; 91; ,1; 3; 12; 19; 40; 44; 48; 56; 63; 66; 72; 80; 84; 85; 95;
52 | 50,1538.755040665894,2532.8694009268866,1547.2944303361437,2162.6363170264585,1; 2; 3; 4; 6; 7; 8; 14; 47; 63; 76; 85; 100; ,11; 18; 25; 29; 31; 38; 41; 42; 64; 82; 89;
53 | 51,1537.5676997150067,2553.461890392309,1547.2944303361437,2162.6363170264585,9; 11; 12; 18; 19; 48; 51; 56; 64; 65; 66; 84; ,7; 26; 27; 30; 32; 36; 39; 40; 59; 75; 89; 91;
54 | 52,1491.3907251272437,2692.8290853866074,1547.2944303361437,2162.6363170264585,26; 27; 30; 32; 36; 39; 40; 58; 59; 74; 75; 80; 87; 91; 97; ,2; 11; 18; 48; 50; 56; 63; 65; 66; 84; 85;
55 | 53,1514.4243794999052,2836.7305498052265,1547.2944303361437,2162.6363170264585,38; 41; 42; 56; 65; 66; 84; 85; ,4; 8; 12; 19; 26; 27; 30; 32; 58; 59; 75; 77; 80; 87; 89; 91; 97;
56 | 54,1475.5132438742721,2609.3850376263263,1547.2944303361437,2162.6363170264585,30; 58; 59; 75; 77; 80; 87; 91; 97; ,7; 11; 22; 38; 41; 42; 56; 65; 66; 84; 85;
57 | 55,1473.241084312323,2570.6459494473715,1547.2944303361437,2162.6363170264585,11; 63; 65; 76; 93; ,6; 18; 36; 39; 40; 47; 58; 59; 75; 77; 80; 87; 97;
58 | 56,1394.3143770751053,2215.0692434057833,1547.2944303361437,2162.6363170264585,12; 18; 22; 24; 27; 35; 36; 37; 39; 40; 48; 49; 80; ,5; 65; 76; 89; 93; 99;
59 | 57,1338.2807102549405,2261.8370016327526,1547.2944303361437,2162.6363170264585,5; 6; 7; 8; 11; 29; 31; 55; 76; ,18; 35; 36; 39; 48; 80; 82;
60 | 58,1376.5444814597877,2627.547171113868,1547.2944303361437,2162.6363170264585,12; 36; 38; 39; 48; 51; 64; 82; 83; 85; ,8; 11; 22; 24; 27; 29; 31; 34; 50; 70; 76; 91;
61 | 59,1307.3201394717403,2273.3722797371347,1547.2944303361437,2162.6363170264585,4; 8; 14; 30; 34; 42; 47; 57; 70; 91; 99; ,12; 25; 48; 49; 51; 55; 68;
62 | 60,1269.5594710794517,2365.933203629548,1547.2944303361437,2162.6363170264585,11; 18; 21; 22; 25; 44; 48; 49; 59; 68; 72; ,8; 14; 42; 47; 57; 85; 91;
63 | 61,1355.8070186011455,2219.659457110626,1547.2944303361437,2162.6363170264585,8; 14; 24; 42; 47; 50; 63; 85; ,11; 18; 48; 72; 83; 99;
64 | 62,1339.383298704961,2402.4972702169616,1547.2944303361437,2162.6363170264585,11; 27; 48; 67; 71; 83; ,8; 14; 22; 24; 30; 38; 44; 47; 63;
65 | 63,1318.5668844119225,1896.0682908947226,1547.2944303361437,1896.0682908947226,38; 44; 52; 57; 99; ,7; 85; 89;
66 | 64,1260.8894575675563,2615.875259225141,1547.2944303361437,1896.0682908947226,22; 63; 89; ,6; 25; 38; 42; 44; 48; 52; 57; 74; 83; 86; 99;
67 | 65,1039.0894778711786,2096.4249794135667,1547.2944303361437,1896.0682908947226,25; 38; 42; 48; 52; 57; 74; 86; 99; ,11; 27; 30; 50; 89;
68 | 66,1095.7300221046082,2226.1728159221275,1547.2944303361437,1896.0682908947226,27; 30; 50; 83; 85; 89; ,12; 22; 34; 38; 40; 42;
69 | 67,1099.95929375257,1954.0255284861714,1547.2944303361437,1896.0682908947226,22; 31; 34; 38; 40; 42; ,46; 83; 85;
70 | 68,959.3842111791618,1973.0453839877378,1547.2944303361437,1896.0682908947226,6; 7; 8; 24; 29; 46; 55; ,38; 40; 42;
71 | 69,950.7119760598545,1699.1822491859873,1547.2944303361437,1699.1822491859873,38; 40; 77; ,
72 | 70,1098.6094762813239,1675.7385452015876,1547.2944303361437,1675.7385452015876,,
73 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM Solomon RC101.100/output/output_profit.csv:
--------------------------------------------------------------------------------
1 | iteration,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,
2 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
4 | 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
5 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
6 | 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
7 | 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
8 | 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
9 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
10 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
11 | 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,9,9,9,9,9,9,9,
12 | 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,10,10,10,10,10,10,10,10,10,9,10,9,9,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,9,10,8,9,10,10,10,10,10,10,9,10,10,
13 | 11,10,11,11,10,11,10,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,10,9,11,11,11,11,11,10,11,10,10,10,10,10,9,10,11,11,11,11,11,11,11,11,11,8,11,11,10,11,11,11,11,9,11,8,9,10,10,10,10,10,11,9,11,10,
14 | 12,10,12,12,10,12,10,11,11,12,12,12,12,12,12,12,12,12,12,11,11,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,10,12,12,11,12,11,12,12,11,10,8,12,12,12,12,12,10,12,10,9,11,11,10,8,10,12,12,12,12,12,12,12,12,12,7,12,11,10,11,11,12,12,8,12,8,8,10,11,11,10,11,12,8,12,10,
15 | 13,10,12,12,10,13,10,11,11,13,13,13,13,13,13,13,13,13,12,11,11,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,13,12,13,10,13,13,11,13,12,13,13,10,11,9,13,13,13,13,13,10,13,11,9,12,11,10,9,10,13,13,13,13,13,13,13,13,13,6,13,12,10,12,12,13,13,9,13,8,8,10,11,11,10,10,13,9,13,10,
16 | 14,10,12,12,10,13,11,11,11,14,14,14,14,14,14,14,14,14,13,12,12,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,12,12,12,12,12,14,12,13,10,14,14,12,14,12,14,14,10,11,9,14,14,14,14,14,11,14,11,8,12,12,10,9,10,14,14,14,14,14,14,14,14,14,5,14,12,10,12,12,14,14,9,14,8,8,11,11,12,11,10,14,9,14,10,
17 | 15,10,12,13,10,14,11,11,11,15,15,14,13,15,13,13,14,15,14,12,12,13,13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,13,13,13,13,13,15,13,13,10,13,15,12,15,12,14,14,10,10,9,14,15,15,14,15,11,14,12,7,11,12,8,9,9,14,15,15,15,15,15,15,14,15,4,15,12,10,12,12,14,15,9,15,8,6,10,12,12,10,10,15,9,14,9,
18 | 16,10,12,14,10,15,11,11,11,15,15,14,14,15,13,13,14,15,15,12,12,13,13,13,13,16,16,16,16,16,16,16,16,16,16,16,15,16,13,13,13,13,13,16,14,13,10,13,16,12,16,12,14,15,10,10,9,14,16,16,15,16,12,14,13,6,11,13,8,9,9,15,16,16,16,16,16,16,15,16,3,16,12,10,12,12,14,16,9,16,8,6,10,12,13,10,10,16,9,14,9,
19 | 17,10,12,14,10,15,11,11,12,16,16,15,14,16,13,13,14,16,16,12,12,13,13,13,13,17,17,17,17,17,17,17,17,17,17,17,16,17,13,13,13,13,13,17,14,13,10,13,17,12,17,13,15,16,9,11,10,15,17,17,15,17,12,15,14,6,12,13,8,10,9,15,17,17,17,17,17,17,15,17,3,17,13,10,13,13,15,17,10,17,8,7,10,12,13,10,9,17,10,15,8,
20 | 18,10,12,14,10,15,11,12,12,15,15,15,14,15,13,12,13,15,17,13,12,14,13,14,13,18,18,18,17,17,17,17,18,18,17,17,17,17,13,13,13,14,13,17,14,13,10,13,18,12,17,13,15,17,9,11,10,14,18,18,16,17,13,15,15,5,11,14,8,9,9,16,18,18,18,18,18,18,16,18,2,17,12,10,13,13,15,18,10,18,8,7,9,11,14,10,9,18,10,14,8,
21 | 19,10,12,14,10,15,12,12,12,15,15,15,15,16,13,12,13,15,17,13,12,14,14,14,13,19,19,19,17,17,17,17,19,19,17,17,17,16,12,12,12,14,13,16,14,13,10,13,19,12,17,13,16,17,8,11,10,15,19,19,16,17,13,15,16,5,11,14,7,9,8,16,18,19,19,19,19,19,17,19,2,17,13,10,13,13,16,19,10,19,8,6,7,11,14,9,8,19,10,15,7,
22 | 20,10,12,14,10,15,12,13,12,15,16,15,15,17,13,13,14,16,17,13,11,14,14,14,13,19,19,20,17,17,17,17,19,20,17,18,18,17,12,13,12,14,13,17,14,13,10,13,19,11,18,14,15,16,7,11,11,14,20,20,16,17,14,16,17,4,11,15,7,8,8,17,18,20,19,20,20,20,17,20,2,17,13,9,14,14,16,19,9,20,8,6,7,11,15,10,7,19,9,14,7,
23 | 21,10,13,14,10,15,12,13,12,15,16,16,15,17,13,13,14,16,17,13,11,15,14,15,14,19,19,21,17,17,17,17,19,21,17,18,18,17,12,13,12,15,14,17,15,13,10,13,19,11,19,14,15,16,8,12,11,14,21,21,16,18,14,16,17,4,10,15,8,8,8,17,18,21,20,21,21,21,17,21,2,18,13,9,14,14,16,20,9,21,8,6,5,10,15,9,8,20,9,14,7,
24 | 22,10,13,14,10,15,12,13,13,14,16,15,15,17,12,13,14,16,18,13,11,15,14,15,15,19,19,22,17,17,17,17,19,22,17,19,19,17,12,14,12,15,14,17,15,13,10,12,19,11,20,14,15,17,8,12,11,14,21,22,17,18,14,17,17,3,10,15,7,8,8,17,18,22,21,22,22,21,18,22,2,18,13,8,14,14,16,20,9,22,8,6,4,10,14,9,7,20,9,14,6,
25 | 23,10,13,14,10,15,12,14,13,14,16,16,15,17,12,13,14,16,18,14,11,15,14,15,15,20,20,23,17,17,17,17,20,23,17,18,19,16,11,13,11,16,14,16,15,13,10,12,19,11,20,13,16,17,9,13,10,15,22,23,17,18,15,17,17,2,10,16,8,7,8,18,18,23,21,23,22,22,18,23,1,18,13,8,13,14,16,20,9,23,8,5,3,10,15,9,8,20,9,14,6,
26 | 24,10,14,14,10,15,12,14,13,14,16,16,16,17,12,13,14,16,18,14,11,15,15,15,16,20,21,24,18,18,18,18,21,24,18,19,19,17,11,13,11,16,14,17,16,13,10,12,19,11,21,14,15,17,8,14,11,15,22,24,17,18,15,18,18,2,10,16,7,7,8,18,19,24,22,24,23,22,18,24,2,18,12,8,14,15,15,20,9,24,8,6,3,11,15,9,7,20,9,14,6,
27 | 25,10,14,14,10,15,13,14,13,13,16,16,15,17,11,13,14,16,17,13,10,15,15,15,16,20,21,25,18,18,18,18,21,25,18,19,20,17,11,13,11,17,15,17,16,13,10,11,19,10,22,14,16,17,8,15,11,16,22,25,17,18,16,18,18,1,10,17,7,6,8,19,19,25,22,25,23,22,18,25,2,18,12,7,14,16,15,19,9,25,8,6,2,10,15,9,7,19,9,14,6,
28 | 26,10,13,14,9,15,12,13,12,13,16,16,15,17,11,12,13,16,18,13,10,15,15,15,17,20,21,25,17,18,18,18,21,24,17,18,20,16,11,13,10,16,14,17,16,13,9,11,19,10,22,15,16,16,8,15,11,16,23,26,17,18,16,18,19,1,9,17,6,6,7,19,19,26,23,26,23,23,18,26,2,18,11,7,14,16,15,20,9,26,8,6,1,10,15,8,7,20,9,14,5,
29 | 27,10,13,14,9,15,12,13,13,13,17,15,14,18,10,13,14,17,18,14,10,15,15,15,17,21,22,25,17,19,18,19,22,24,17,18,20,16,10,13,9,16,14,17,16,13,9,11,19,10,22,15,16,17,8,15,11,16,23,27,17,18,16,19,19,1,9,17,6,7,8,19,18,26,24,27,24,23,19,26,1,18,11,8,14,16,15,20,10,27,8,5,1,10,15,8,6,20,10,14,5,
30 | 28,10,13,14,9,15,12,14,13,13,17,15,15,18,10,13,14,17,18,14,10,16,15,16,17,21,21,26,17,18,17,18,21,24,16,18,20,16,11,13,9,17,14,17,16,13,9,11,20,10,23,15,16,17,9,15,11,17,23,28,16,18,16,20,18,1,10,17,6,7,8,19,19,26,24,28,25,24,18,26,1,18,10,7,14,16,15,20,10,28,9,5,1,9,15,8,6,20,10,15,5,
31 | 29,10,14,14,9,15,12,14,13,12,17,14,15,18,10,13,14,17,18,13,10,15,15,15,17,21,22,26,18,18,17,18,22,25,16,18,20,16,10,13,9,16,14,17,16,13,9,11,19,10,23,15,17,17,9,15,10,17,22,29,17,18,17,19,19,1,9,18,7,6,8,20,18,27,24,29,24,24,19,27,1,18,9,6,13,16,15,20,10,29,8,5,1,10,16,7,6,20,10,15,5,
32 | 30,10,14,14,9,15,13,14,13,12,17,15,15,18,10,13,14,17,18,13,10,16,15,16,17,21,22,26,17,18,17,18,22,24,15,18,20,16,11,13,9,17,14,17,16,13,9,11,20,10,23,15,18,17,10,15,10,17,23,30,17,18,17,20,18,1,9,18,7,6,8,20,19,26,24,30,25,25,19,27,1,18,9,6,13,16,15,21,10,30,8,5,2,10,16,7,6,21,9,15,5,
33 | 31,11,14,15,9,15,13,14,13,12,18,15,15,19,10,14,15,18,18,14,9,16,14,16,17,21,22,26,17,19,17,19,22,24,15,18,20,16,10,13,9,16,14,17,16,13,9,11,19,9,24,15,17,17,9,15,10,17,22,31,17,18,17,20,19,1,9,18,6,6,8,20,18,27,25,31,25,24,19,28,2,18,9,7,13,17,15,20,10,31,8,6,1,10,16,6,5,20,9,15,5,
34 | 32,11,14,15,9,16,13,14,13,12,18,15,16,19,10,14,15,18,18,14,10,16,15,16,17,22,22,26,17,18,17,18,22,24,14,18,20,16,11,13,9,17,14,17,16,14,9,11,19,10,24,15,17,17,10,15,10,17,23,32,16,18,17,21,19,1,9,18,6,6,8,20,19,27,25,32,26,25,18,28,1,18,9,7,13,17,15,21,10,32,8,5,2,10,16,6,6,21,9,15,5,
35 | 33,10,13,14,8,15,12,14,13,11,18,14,16,19,10,14,15,18,18,13,9,16,14,16,17,21,22,26,17,19,17,19,22,24,14,18,20,16,10,13,9,16,14,17,16,13,8,11,19,9,25,16,17,18,9,15,10,18,23,33,16,18,17,21,19,1,9,18,6,7,8,20,18,27,25,33,26,25,19,28,2,18,9,7,13,17,15,20,10,33,8,6,1,10,16,5,5,20,9,15,4,
36 | 34,10,14,14,8,15,12,14,13,11,18,14,15,19,9,14,15,18,18,13,10,16,15,16,17,22,22,26,17,18,17,18,22,24,13,18,20,16,11,13,9,17,14,17,16,13,8,11,19,10,25,15,17,18,9,15,9,18,22,34,15,18,17,21,19,1,9,18,6,6,8,20,19,27,25,34,26,25,19,28,1,18,8,6,12,17,14,20,10,34,9,5,1,10,16,4,5,20,9,15,4,
37 | 35,10,14,14,8,15,13,14,13,11,18,15,15,19,8,14,15,18,18,14,9,16,14,16,17,21,22,26,17,19,17,19,22,24,13,18,20,16,11,13,10,17,15,17,17,13,8,10,19,9,26,15,17,18,9,15,9,18,23,35,15,18,17,22,19,1,9,18,7,6,8,20,19,27,26,35,27,26,19,28,2,18,9,7,12,17,15,21,10,35,8,6,2,10,16,4,5,21,9,15,4,
38 | 36,10,14,14,9,15,13,14,14,11,18,15,16,19,8,14,15,18,18,14,9,16,14,16,16,21,23,27,17,19,17,19,23,25,13,18,20,16,11,13,9,17,14,17,16,13,8,10,19,9,26,16,16,18,9,15,9,18,22,35,15,18,17,22,20,1,9,18,7,6,8,20,19,27,26,36,27,26,19,28,1,18,8,7,12,17,14,20,10,36,8,5,1,10,16,3,5,21,9,15,4,
39 | 37,10,14,14,9,15,14,14,14,11,18,14,16,19,8,14,15,18,18,14,9,16,14,16,16,21,23,26,17,19,16,19,23,25,12,19,20,17,11,13,9,17,15,18,17,13,8,11,18,9,26,16,16,18,9,15,9,18,22,35,15,18,17,23,20,1,9,18,7,6,8,20,19,27,26,37,28,27,20,28,1,18,8,7,12,17,14,20,10,37,8,5,1,10,16,3,5,22,9,15,4,
40 | 38,11,14,15,9,15,14,14,14,11,18,15,16,19,8,14,15,18,18,14,10,16,15,16,16,22,24,27,17,19,17,19,24,25,12,18,20,16,11,13,9,17,14,17,16,13,8,11,18,10,26,16,17,17,9,14,9,19,22,35,16,18,17,23,21,2,9,18,6,5,8,20,19,27,26,37,28,27,20,29,2,18,8,7,12,18,14,19,10,38,8,5,1,10,16,2,5,21,8,15,4,
41 | 39,10,13,14,8,15,13,13,13,11,18,15,15,19,8,14,15,18,18,14,9,17,14,17,16,21,24,27,17,18,17,18,24,25,11,18,20,16,11,13,10,17,15,17,17,13,8,11,18,9,26,16,16,17,10,15,8,19,22,36,15,18,18,23,20,1,8,19,7,5,8,21,19,27,27,38,28,27,20,29,1,18,8,7,11,17,14,19,10,39,8,5,1,10,17,2,6,21,8,15,3,
42 | 40,10,13,14,8,15,13,14,13,11,18,16,15,19,8,14,15,18,18,14,10,17,15,17,16,22,24,27,17,19,17,19,24,25,11,18,20,16,11,13,9,17,14,17,16,13,8,11,18,10,27,16,16,17,9,15,9,19,22,36,16,18,18,24,20,1,9,19,6,6,8,21,19,27,27,38,28,27,20,30,1,18,9,6,12,18,14,19,11,39,8,5,2,10,17,2,5,21,8,15,3,
43 | 41,10,14,14,8,15,13,14,13,11,18,16,16,19,8,14,15,18,18,14,9,16,14,16,16,21,24,27,18,19,17,19,24,26,11,18,20,16,11,13,10,17,15,17,17,13,8,11,18,9,28,16,17,18,9,15,9,19,22,36,15,18,18,24,20,1,9,19,6,6,8,21,19,26,27,38,27,27,20,29,1,18,8,6,12,18,14,19,11,39,8,5,1,10,17,2,5,21,8,15,3,
44 | 42,10,14,14,9,15,13,14,14,11,18,16,16,19,8,13,14,18,18,14,10,16,15,16,16,22,24,27,17,19,17,19,24,25,10,18,21,16,12,14,10,17,15,17,17,13,8,11,18,10,28,16,17,17,9,15,9,19,22,36,15,18,18,24,20,1,9,19,7,6,8,21,19,27,27,38,26,27,20,30,1,18,8,6,12,18,14,19,11,39,8,4,1,10,17,2,5,21,8,15,4,
45 | 43,10,14,14,9,15,14,14,14,11,18,15,16,19,8,13,14,18,18,14,9,17,14,17,16,21,24,27,18,19,17,19,24,26,10,18,20,16,12,13,9,17,15,17,17,13,8,11,18,9,29,17,16,17,9,14,9,18,22,36,15,18,18,24,20,0,9,19,6,6,8,21,19,26,27,38,26,27,20,29,1,18,8,7,12,18,14,19,11,40,9,5,1,10,17,2,5,21,8,14,4,
46 | 44,11,14,15,9,15,14,14,14,11,18,15,17,19,8,13,14,18,18,15,9,17,14,17,16,21,24,27,17,19,17,19,24,25,9,18,20,16,11,13,9,16,14,17,17,13,8,11,19,9,29,17,16,17,9,14,9,18,22,36,15,18,18,25,20,1,9,19,6,6,8,21,19,26,27,38,27,27,20,29,1,18,8,6,12,18,14,19,11,41,8,5,1,10,17,2,5,21,8,14,4,
47 | 45,10,13,14,8,15,13,14,13,11,18,16,17,19,8,13,14,18,18,15,10,17,15,17,16,22,24,27,18,19,17,19,24,26,10,18,20,16,12,13,9,17,15,17,17,13,7,11,19,10,29,15,16,17,9,14,9,18,22,36,15,18,18,25,19,0,9,19,6,6,7,21,19,26,27,38,26,27,20,29,1,18,8,6,12,17,14,19,11,41,8,4,1,10,17,2,5,21,8,14,3,
48 | 46,10,14,14,8,15,13,14,13,11,18,15,17,19,8,13,14,18,18,14,9,16,15,16,16,21,24,28,17,19,17,19,24,25,9,18,21,16,12,14,10,17,15,17,17,13,7,12,19,9,29,16,16,17,9,14,9,18,22,36,15,18,18,24,20,0,9,19,6,6,7,21,19,26,27,38,26,27,21,29,2,18,8,6,12,17,14,19,11,42,8,5,1,9,17,1,5,21,8,14,3,
49 | 47,10,14,14,9,15,13,14,13,11,18,16,17,19,7,13,14,18,18,14,10,16,16,16,16,22,24,27,17,19,16,19,24,25,9,18,20,16,12,13,9,17,15,17,17,13,8,11,19,10,29,15,17,17,9,14,9,18,22,36,15,18,18,25,19,1,9,19,6,5,7,21,19,26,27,38,26,27,21,29,1,18,8,6,12,17,14,19,11,42,8,4,1,9,17,2,5,21,8,14,4,
50 | 48,10,14,14,9,15,13,14,14,11,18,16,18,19,7,13,14,18,18,14,9,15,15,15,16,21,24,27,17,18,16,18,24,25,9,18,20,16,11,13,9,16,14,17,17,13,8,11,19,9,29,16,17,17,9,14,9,18,22,36,15,18,18,25,20,0,9,19,6,5,8,21,19,26,27,38,26,27,21,29,1,18,8,6,12,17,14,19,11,43,8,4,1,9,17,1,5,21,8,14,4,
51 | 49,10,14,14,9,15,14,14,14,11,18,16,17,19,8,13,14,18,18,14,9,16,15,16,17,21,24,27,17,19,16,19,24,25,9,18,20,16,11,13,8,16,14,17,16,13,8,12,19,9,30,16,17,17,9,14,9,18,22,36,15,18,18,25,19,1,9,19,6,5,8,21,18,26,27,38,25,27,21,29,1,18,8,6,12,17,14,19,11,43,8,4,1,9,17,1,5,21,8,14,4,
52 | 50,11,14,15,9,15,14,14,14,11,18,16,18,19,8,13,14,18,18,15,9,16,15,16,17,21,24,27,17,18,16,18,24,25,9,18,20,16,11,13,9,16,14,17,17,13,8,12,20,9,30,16,17,17,9,14,10,18,22,36,15,18,18,26,19,1,10,19,6,5,8,21,19,26,27,38,25,27,21,29,2,18,8,6,13,18,14,19,11,43,8,3,1,9,17,2,5,21,8,14,4,
53 | 51,10,13,14,8,15,13,13,13,11,18,17,18,19,7,13,14,18,19,15,9,16,15,16,17,22,24,27,17,19,16,19,24,25,9,18,20,16,12,13,9,17,15,17,17,13,8,11,20,9,30,16,17,17,9,14,10,18,22,36,15,18,18,25,20,1,10,19,6,5,8,21,19,26,27,38,24,27,21,29,2,18,9,6,13,17,14,19,11,44,8,3,1,9,17,2,5,21,8,14,3,
54 | 52,10,13,14,8,15,13,15,13,9,18,13,16,19,7,13,14,18,17,13,9,16,15,16,17,22,26,29,17,19,18,19,26,25,9,18,22,16,12,15,11,17,15,17,17,13,8,11,18,9,30,14,17,17,9,14,8,18,22,38,15,18,18,25,18,-1,8,19,6,5,8,21,19,26,27,40,24,27,21,29,2,18,9,6,11,17,14,19,11,46,8,5,1,9,17,2,5,21,8,14,3,
55 | 53,10,16,14,8,15,13,15,13,9,18,16,16,19,7,13,14,18,20,13,9,16,15,16,17,22,23,26,17,19,15,19,23,25,9,18,19,16,12,12,8,17,15,17,17,13,8,11,21,9,33,14,17,17,9,14,11,18,19,35,15,18,18,28,18,2,11,19,6,5,8,21,19,26,24,37,24,27,21,29,-1,18,9,6,14,20,14,16,11,46,8,2,1,9,17,2,5,18,8,14,3,
56 | 54,10,16,14,12,15,13,15,17,9,18,16,20,19,7,13,14,18,20,17,9,16,15,16,17,22,27,30,17,19,19,19,27,25,9,18,19,16,8,12,8,13,11,17,17,13,8,11,21,9,33,14,17,17,9,14,7,18,23,39,15,18,18,28,18,-2,7,19,6,5,8,21,19,26,24,41,24,31,21,29,3,18,9,6,10,16,14,20,11,50,8,6,1,9,17,2,5,22,8,14,3,
57 | 55,10,16,14,12,15,13,20,17,9,18,21,20,19,7,13,14,18,20,17,9,16,20,16,17,22,27,30,17,19,14,19,27,25,9,18,19,16,13,12,8,18,16,17,17,13,8,11,21,9,33,14,17,17,9,14,12,18,18,34,15,18,18,28,18,3,12,19,6,5,8,21,19,26,24,36,24,26,21,29,-2,18,9,6,15,21,14,15,11,50,8,1,1,9,17,2,5,17,8,14,3,
58 | 56,10,16,14,12,15,19,20,17,9,18,15,20,19,7,13,14,18,26,17,9,16,20,16,17,22,27,30,17,19,14,19,27,25,9,18,25,16,13,18,14,18,16,17,17,13,8,17,21,9,33,14,17,17,9,14,12,18,24,40,15,18,18,22,18,-3,12,19,6,5,8,21,19,26,24,42,18,32,21,29,4,18,9,6,15,21,14,21,11,50,8,1,1,3,17,2,5,23,8,14,3,
59 | 57,10,16,14,12,22,19,20,17,9,18,15,13,19,7,13,14,18,19,17,9,16,13,16,10,22,27,23,17,19,14,19,27,25,9,11,18,9,13,11,7,18,16,17,17,13,8,17,14,2,33,14,17,17,9,14,12,18,24,40,15,18,18,22,18,4,12,19,6,5,8,21,19,26,24,42,25,32,21,29,-3,18,9,6,15,21,14,21,11,57,8,1,1,10,17,2,5,23,8,21,3,
60 | 58,10,16,14,12,14,11,12,9,9,18,7,13,19,7,13,14,18,27,17,9,16,13,16,10,22,27,23,17,11,14,11,27,25,9,19,26,9,13,19,7,18,16,17,17,13,8,17,22,2,33,14,17,17,9,6,12,18,24,40,15,18,18,22,18,4,12,19,6,5,8,21,19,26,24,42,17,32,21,29,5,18,17,6,15,21,14,21,11,57,8,1,1,10,17,2,5,23,8,21,3,
61 | 59,10,16,14,12,14,11,12,18,9,18,16,4,19,7,13,14,18,27,17,9,16,22,16,19,22,27,32,17,20,14,20,27,25,18,19,17,9,4,10,7,18,16,17,17,13,8,17,13,2,42,5,17,17,9,6,12,18,24,40,15,18,18,22,9,4,12,19,6,5,17,21,19,26,24,42,26,32,21,29,5,18,8,-3,15,12,14,21,11,57,8,10,1,10,17,2,5,23,8,21,3,
62 | 60,10,16,14,2,14,11,12,8,9,18,16,14,19,-3,13,14,18,27,17,9,16,22,16,19,32,27,32,17,20,4,20,27,25,8,19,17,9,4,10,7,18,6,17,17,13,8,7,23,12,42,15,17,17,9,16,12,8,24,40,15,18,18,22,9,4,12,19,16,5,7,21,19,26,24,42,26,32,21,29,5,18,8,-3,15,12,14,21,11,57,8,0,1,10,17,2,5,23,8,11,3,
63 | 61,10,16,14,2,14,11,12,19,9,18,5,14,19,8,13,14,18,16,17,9,5,11,16,19,21,27,32,17,20,4,20,27,25,8,19,17,9,4,10,7,18,17,17,6,13,8,18,12,1,42,15,17,17,9,16,12,19,24,29,15,18,18,22,9,4,12,19,5,5,7,21,8,26,24,42,26,32,21,29,5,18,8,-3,15,23,14,21,11,57,8,11,1,10,17,2,5,23,8,11,3,
64 | 62,10,16,14,2,14,11,12,7,9,18,17,14,19,-4,13,14,18,28,17,9,5,11,16,7,21,27,32,17,20,4,20,27,25,8,19,17,9,4,10,7,18,5,17,6,13,8,6,24,1,30,15,17,17,9,16,12,19,24,29,15,18,18,10,9,4,12,19,5,5,7,21,20,26,24,42,26,32,21,29,5,18,8,9,15,11,14,21,11,57,8,11,1,10,17,2,5,23,8,23,3,
65 | 63,10,16,14,2,14,11,12,20,9,18,4,14,19,9,13,14,18,28,17,9,5,24,16,20,21,27,19,17,20,17,20,27,25,8,19,17,9,17,10,7,18,5,17,19,13,8,19,11,1,30,15,17,17,9,16,12,19,24,29,15,18,18,23,9,4,12,6,5,5,7,8,20,26,24,42,26,32,21,29,5,18,8,-4,15,11,14,21,11,57,8,11,1,10,17,2,5,23,8,23,3,
66 | 64,10,16,14,2,14,11,26,20,9,18,4,14,19,9,13,14,18,28,17,9,5,24,16,20,21,27,19,17,20,17,20,27,25,8,19,17,9,3,10,7,18,5,17,5,13,8,19,11,1,30,15,3,17,9,16,12,5,24,29,15,18,18,23,9,4,12,6,5,5,7,8,20,26,24,42,26,32,21,29,5,18,8,-4,15,25,14,21,11,71,8,11,1,10,17,2,5,23,8,9,3,
67 | 65,10,16,14,2,14,26,26,20,9,18,4,14,19,9,13,14,18,28,17,9,5,9,16,20,36,27,19,17,20,17,20,27,25,8,19,17,9,18,10,7,18,20,17,20,13,8,19,26,1,30,15,18,17,9,16,12,20,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,39,42,26,32,21,29,5,18,8,11,15,25,29,21,11,56,8,11,1,10,17,2,5,23,8,24,3,
68 | 66,10,16,14,2,14,26,26,20,9,18,20,14,19,9,13,14,18,28,17,9,5,9,16,20,20,27,35,17,20,33,20,27,25,8,19,17,9,2,10,7,18,4,17,20,13,8,19,10,1,46,15,2,17,9,16,12,4,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,23,42,26,32,21,29,5,18,8,11,15,25,13,21,11,72,8,11,1,10,17,2,5,23,8,8,3,
69 | 67,10,16,14,2,14,26,26,20,9,18,20,31,19,9,13,14,18,28,17,9,5,26,16,20,20,27,18,17,20,16,20,27,25,25,19,17,9,19,10,24,18,21,17,20,13,8,19,10,1,29,15,2,17,9,16,12,4,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,23,42,26,32,21,29,5,18,8,-6,15,8,13,21,11,55,8,11,1,10,17,2,5,23,8,8,3,
70 | 68,10,16,14,2,14,26,26,20,9,18,20,31,19,9,13,14,18,28,17,9,5,8,16,20,20,27,18,17,20,16,2,27,25,7,19,17,9,1,10,6,18,3,17,20,13,26,19,10,1,29,15,2,17,9,16,12,4,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,23,42,26,32,21,29,5,18,8,12,15,26,13,21,11,55,8,11,1,10,17,2,5,23,8,8,3,
71 | 69,10,16,14,2,14,7,7,1,9,18,20,31,19,9,13,14,18,28,17,9,5,8,16,1,20,27,18,17,1,16,2,27,25,7,19,17,9,20,10,25,18,22,17,20,13,7,19,10,1,29,15,2,17,9,-3,12,4,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,23,42,26,32,21,29,5,18,8,12,15,26,13,21,11,55,8,11,1,10,17,2,5,23,8,8,3,
72 | 70,10,16,14,2,14,7,7,1,9,18,20,31,19,9,13,14,18,28,17,9,5,8,16,1,20,27,18,17,1,16,2,27,25,7,19,17,9,0,10,5,18,22,17,20,13,7,19,10,1,29,15,2,17,9,-3,12,4,24,29,15,18,18,8,9,4,12,6,5,5,7,8,20,26,23,42,26,12,21,29,5,18,8,12,15,26,13,21,11,55,8,11,1,10,17,2,5,23,8,8,3,
73 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/ADMM_Python1+2.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import copy
3 | import time
4 |
5 |
6 | class Node:
7 | def __init__(self):
8 | self.node_id = 0
9 | self.x = 0.0
10 | self.y = 0.0
11 | self.type = 0
12 | self.outgoing_node_id_list = []
13 | self.outgoing_node_size = 0
14 | self.outgoing_link_obj_list = []
15 | self.weight = 0.0
16 | self.volume = 0.0
17 | self.m_activity_node_beginning_time = 0
18 | self.m_activity_node_ending_time = 0
19 | self.base_profit_for_admm = 0
20 | self.base_profit_for_lr = 0
21 |
22 |
23 | class Link:
24 | def __init__(self):
25 | self.link_id = 0
26 | self.from_node_id = 0
27 | self.to_node_id = 0
28 | self.distance = 0.0
29 | self.spend_tm = 0
30 |
31 |
32 | class Agent:
33 | def __init__(self):
34 | self.agent_id = 0
35 | self.from_node_id = 0
36 | self.to_node_id = 0
37 | self.departure_time_beginning = 0.0
38 | self.arrival_time_beginning = 0.0
39 | self.capacity_wei = 0 # weight capacity
40 | self.capacity_vol = 0 # volume capacity
41 |
42 |
43 | def g_read_input_data():
44 | global g_number_of_nodes
45 | global g_number_of_customers
46 | global g_number_of_links
47 | global g_number_of_vehicles
48 |
49 | # step 1: read NODEs information
50 |
51 | # step 1.1: set the origin depot
52 | node = Node()
53 | node.node_id = 0
54 | node.type = 1
55 | node.x = 116.571614
56 | node.y = 39.792844
57 | node.m_activity_node_beginning_time = 0
58 | node.m_activity_node_ending_time = g_number_of_time_intervals
59 | g_node_list.append(node)
60 | g_number_of_nodes += 1
61 |
62 | # step 1.2: set the customers
63 | with open('./input/input_node_100.csv', 'r') as fp:
64 | print('read input_node_100.csv')
65 |
66 | reader = csv.DictReader(fp)
67 | for line in reader:
68 | node = Node()
69 | node.node_id = int(line["ID"])
70 | node.type = 2
71 | node.x = float(line["lng"])
72 | node.y = float(line["lat"])
73 | node.weight = float(line["pack_total_weight"])
74 | node.volume = float(line["pack_total_volume"])
75 | node.m_activity_node_beginning_time = int(line["first_receive_tm"])
76 | node.m_activity_node_ending_time = int(line["last_receive_tm"])
77 | g_node_list.append(node)
78 | node.base_profit_for_admm = base_profit
79 | node.base_profit_for_lr = base_profit
80 | g_number_of_nodes += 1
81 | g_number_of_customers += 1
82 | print('customers_number:{}'.format(g_number_of_customers))
83 |
84 | # step 1.3: set the destination node
85 | node = Node()
86 | node.type = 1
87 | node.node_id = g_number_of_nodes
88 | node.x = 116.571614
89 | node.y = 39.792844
90 | node.m_activity_node_beginning_time = 0
91 | node.m_activity_node_ending_time = g_number_of_time_intervals
92 | g_node_list.append(node)
93 | g_number_of_nodes += 1
94 |
95 | print('nodes_number:{}'.format(g_number_of_nodes))
96 |
97 | # step 2: read LINKs information
98 | with open('./input/input_link_100.csv', 'r') as fp:
99 | print('read input_link_100.csv')
100 |
101 | reader = csv.DictReader(fp)
102 | for line in reader:
103 | link = Link()
104 | link.link_id = int(line["ID"])
105 | link.from_node_id = int(line["from_node"])
106 | link.to_node_id = int(line["to_node"])
107 | link.distance = int(line["distance"])
108 | link.spend_tm = int(line["spend_tm"])
109 | if (link.to_node_id == destination_node) or (link.from_node_id == origin_node) or (link.spend_tm <= 50):
110 | g_node_list[link.from_node_id].outgoing_node_id_list.append(link.to_node_id)
111 | g_node_list[link.from_node_id].outgoing_node_size = len(g_node_list[link.from_node_id].outgoing_node_id_list)
112 | g_node_list[link.from_node_id].outgoing_link_obj_list.append(link)
113 | g_link_list.append(link)
114 | g_number_of_links += 1
115 |
116 | print('links_number:{}'.format(g_number_of_links))
117 |
118 | # step 3: set VEHICLEs information
119 | for i in range(vehicle_fleet_size):
120 | agent = Agent()
121 | agent.agent_id = i
122 | agent.from_node_id = 0
123 | agent.to_node_id = g_number_of_nodes - 1
124 | agent.departure_time_beginning = 0
125 | agent.arrival_time_ending = g_number_of_time_intervals
126 | agent.capacity_wei = 2.0
127 | agent.capacity_vol = 12.0
128 | g_agent_list.append(agent)
129 | g_number_of_vehicles += 1
130 |
131 | print('vehicles_number:{}'.format(g_number_of_vehicles))
132 |
133 |
134 | class VSState:
135 | def __init__(self):
136 | self.current_node_id = 0
137 | self.m_visit_node_sequence = []
138 | self.m_visit_time_sequence = []
139 | self.m_vehicle_capacity_wei = 0
140 | self.m_vehicle_capacity_vol = 0
141 |
142 | self.passenger_service_state = [0] * g_number_of_nodes
143 | self.passenger_vehicle_visit_allowed_flag = [1] * g_number_of_nodes
144 |
145 | self.label_cost_for_admm = 0 # with LR price and rho
146 | self.label_cost_for_lr = 0 # with LR price
147 | self.primal_label_cost = 0 # without LR price
148 |
149 | self.total_travel_cost = 0
150 | self.total_waiting_cost = 0
151 | self.total_fixed_cost = 0
152 |
153 | def my_copy(self, current_element):
154 | self.current_node_id = current_element.current_node_id
155 | self.m_visit_node_sequence = copy.copy(current_element.m_visit_node_sequence)
156 | self.m_visit_time_sequence = copy.copy(current_element.m_visit_time_sequence)
157 | self.m_vehicle_capacity_wei = current_element.m_vehicle_capacity_wei
158 | self.m_vehicle_capacity_vol = current_element.m_vehicle_capacity_vol
159 |
160 | self.passenger_service_state = copy.copy(current_element.passenger_service_state)
161 | self.passenger_vehicle_visit_allowed_flag = copy.copy(current_element.passenger_vehicle_visit_allowed_flag)
162 |
163 | self.label_cost_for_admm = current_element.label_cost_for_admm
164 | self.label_cost_for_lr = current_element.label_cost_for_lr
165 | self.primal_label_cost = current_element.primal_label_cost
166 |
167 | self.total_travel_cost = current_element.total_travel_cost
168 | self.total_waiting_cost = current_element.total_waiting_cost
169 | self.total_fixed_cost = current_element.total_fixed_cost
170 |
171 | def calculate_label_cost(self):
172 |
173 | # fixed_cost for each vehicle
174 | if from_node_id == 0 and to_node_id != g_number_of_nodes - 1:
175 | self.label_cost_for_admm += + fixed_cost
176 | self.label_cost_for_lr += fixed_cost
177 | self.primal_label_cost += fixed_cost
178 | self.total_fixed_cost += fixed_cost
179 |
180 | # transportation_cost
181 | self.label_cost_for_admm = self.label_cost_for_admm - g_node_list[to_node_id].base_profit_for_admm + link_obj.distance / 1000.0 * 12.0
182 | self.label_cost_for_lr = self.label_cost_for_lr - g_node_list[to_node_id].base_profit_for_lr + link_obj.distance / 1000.0 * 12.0 # no necessary
183 | self.primal_label_cost = self.primal_label_cost + link_obj.distance / 1000.0 * 12.0
184 | self.total_travel_cost += link_obj.distance / 1000.0 * 12.0
185 |
186 | # waiting_cost
187 | if from_node_id != 0 and waiting_cost_flag == 1:
188 | self.label_cost_for_admm += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
189 | self.label_cost_for_lr += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
190 | self.primal_label_cost += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
191 | self.total_waiting_cost += (g_node_list[to_node_id].m_activity_node_beginning_time - next_time) * waiting_arc_cost
192 |
193 | def generate_string_key(self):
194 | return self.current_node_id
195 |
196 |
197 | class Time_Indexed_State_Vector:
198 | def __init__(self):
199 | self.current_time = 0
200 | self.m_VSStateVector = []
201 | self.m_state_map = []
202 |
203 | def m_find_state_index(self, string_key):
204 | if string_key in self.m_state_map:
205 | return self.m_state_map.index(string_key)
206 | else:
207 | return -1
208 |
209 | def update_state(self, new_element, ul_flag):
210 | string_key = new_element.generate_string_key()
211 | state_index = self.m_find_state_index(string_key)
212 | if state_index == -1:
213 | self.m_VSStateVector.append(new_element)
214 | self.m_state_map.append(string_key)
215 | else:
216 | if ul_flag == 0: # ADMM
217 | if new_element.label_cost_for_admm < self.m_VSStateVector[state_index].label_cost_for_admm:
218 | self.m_VSStateVector[state_index] = new_element
219 | else: # LR(ul_flag == 1)
220 | if new_element.label_cost_for_lr < self.m_VSStateVector[state_index].label_cost_for_lr:
221 | self.m_VSStateVector[state_index] = new_element
222 |
223 | def sort(self, ul_flag):
224 | if ul_flag == 0: # ADMM
225 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_admm)
226 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
227 | if ul_flag == 1: # LR
228 | self.m_VSStateVector = sorted(self.m_VSStateVector, key=lambda x: x.label_cost_for_lr)
229 | self.m_state_map = [e.generate_string_key() for e in self.m_VSStateVector]
230 |
231 | def get_best_value(self):
232 | if len(self.m_VSStateVector) >= 1:
233 | return [self.m_VSStateVector[0].label_cost_for_lr, self.m_VSStateVector[0].primal_label_cost, self.m_VSStateVector[0].label_cost_for_admm]
234 |
235 |
236 | def g_time_dependent_dynamic_programming(vehicle_id,
237 | origin_node,
238 | departure_time_beginning,
239 | destination_node,
240 | arrival_time_ending,
241 | beam_width,
242 | ul_flag):
243 | global g_time_dependent_state_vector
244 | global g_ending_state_vector
245 | global g_vehicle_passenger_visit_flag
246 | global g_vehicle_passenger_visit_allowed_flag
247 | global link_obj
248 | global to_node_id
249 | global from_node_id
250 | global waiting_cost_flag
251 | global next_time
252 |
253 | g_time_dependent_state_vector = [None] * (arrival_time_ending - departure_time_beginning + 2)
254 | if arrival_time_ending > g_number_of_time_intervals or g_node_list[origin_node].outgoing_node_size == 0:
255 | return _MAX_LABEL_COST
256 |
257 | # step 2: Initialization for origin node at the preferred departure time
258 |
259 | for t in range(departure_time_beginning, arrival_time_ending + 1):
260 | g_time_dependent_state_vector[t] = Time_Indexed_State_Vector()
261 | g_time_dependent_state_vector[t].current_time = t
262 |
263 | g_ending_state_vector[vehicle_id] = Time_Indexed_State_Vector()
264 |
265 | # origin_node
266 | element = VSState()
267 | element.current_node_id = origin_node
268 | g_time_dependent_state_vector[departure_time_beginning].update_state(element, ul_flag)
269 |
270 | for t in range(departure_time_beginning, arrival_time_ending):
271 | g_time_dependent_state_vector[t].sort(ul_flag)
272 |
273 | for w_index in range(min(beam_width, len(g_time_dependent_state_vector[t].m_VSStateVector))):
274 | current_element = g_time_dependent_state_vector[t].m_VSStateVector[w_index]
275 | from_node_id = current_element.current_node_id
276 | from_node = g_node_list[from_node_id]
277 |
278 | for i in range(from_node.outgoing_node_size):
279 | to_node_id = from_node.outgoing_node_id_list[i]
280 | to_node = g_node_list[to_node_id]
281 | link_obj = from_node.outgoing_link_obj_list[i]
282 | next_time = t + link_obj.spend_tm
283 |
284 | # case 1: to_node is the destination depot
285 | if to_node_id == destination_node:
286 | waiting_cost_flag = 0
287 | new_element = VSState()
288 | new_element.my_copy(current_element)
289 | # wait
290 | new_element.m_visit_time_sequence.append(next_time)
291 | new_element.m_visit_node_sequence.append(to_node_id)
292 | new_element.m_visit_time_sequence.append(arrival_time_ending)
293 | new_element.m_visit_node_sequence.append(to_node_id)
294 | new_element.calculate_label_cost()
295 | g_ending_state_vector[vehicle_id].update_state(new_element, ul_flag)
296 | continue
297 |
298 | # case 2: to_node is the origin depot
299 | if to_node_id == origin_node:
300 | continue
301 |
302 | # case 3: to_node is a customer
303 | if current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 0:
304 | continue
305 | if current_element.passenger_vehicle_visit_allowed_flag[to_node_id] == 1:
306 | # time window constraint
307 | if next_time > to_node.m_activity_node_ending_time:
308 | continue
309 | if next_time + service_length > arrival_time_ending:
310 | continue
311 | # capacity constraint
312 | if current_element.m_vehicle_capacity_wei > g_agent_list[vehicle_id].capacity_wei - to_node.weight:
313 | continue
314 | if current_element.m_vehicle_capacity_vol > g_agent_list[vehicle_id].capacity_vol - to_node.volume:
315 | continue
316 | if next_time < to_node.m_activity_node_beginning_time: # need to wait
317 | waiting_cost_flag = 1
318 | new_element = VSState()
319 | new_element.my_copy(current_element)
320 | new_element.current_node_id = to_node_id
321 | new_element.passenger_service_state[to_node_id] = 1
322 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0
323 |
324 | new_element.m_visit_time_sequence.append(next_time)
325 | new_element.m_visit_node_sequence.append(to_node_id)
326 | new_element.m_vehicle_capacity_wei += to_node.weight
327 | new_element.m_vehicle_capacity_vol += to_node.volume
328 | new_element.m_visit_time_sequence.append(to_node.m_activity_node_beginning_time)
329 | new_element.m_visit_node_sequence.append(to_node_id)
330 |
331 | new_element.calculate_label_cost()
332 | new_element.m_visit_time_sequence.append(to_node.m_activity_node_beginning_time + service_length)
333 | new_element.m_visit_node_sequence.append(to_node_id)
334 | g_time_dependent_state_vector[to_node.m_activity_node_beginning_time + service_length].update_state(new_element, ul_flag)
335 | continue
336 | else: # do not need waiting
337 | waiting_cost_flag = 0
338 | new_element = VSState()
339 | new_element.my_copy(current_element)
340 | new_element.current_node_id = to_node_id
341 | new_element.passenger_service_state[to_node_id] = 1
342 | new_element.passenger_vehicle_visit_allowed_flag[to_node_id] = 0
343 |
344 | new_element.m_visit_time_sequence.append(next_time)
345 | new_element.m_visit_node_sequence.append(to_node_id)
346 | new_element.m_vehicle_capacity_wei += to_node.weight
347 | new_element.m_vehicle_capacity_vol += to_node.volume
348 |
349 | new_element.calculate_label_cost()
350 | new_element.m_visit_time_sequence.append(next_time + service_length)
351 | new_element.m_visit_node_sequence.append(to_node_id)
352 | g_time_dependent_state_vector[next_time + service_length].update_state(new_element, ul_flag)
353 | continue
354 |
355 | g_ending_state_vector[vehicle_id].sort(ul_flag)
356 | return g_ending_state_vector[vehicle_id].get_best_value()
357 |
358 |
359 | def g_alternating_direction_method_of_multipliers():
360 | global gap_threshold
361 | global beam_width
362 | global g_ending_state_vector
363 | global base_profit
364 | global path_node_seq
365 | global path_time_seq
366 | global g_number_of_ADMM_iterations
367 | global global_upperbound
368 | global global_lowerbound
369 | global ADMM_local_lowerbound
370 | global ADMM_local_upperbound
371 | global ADMM_global_lowerbound
372 | global ADMM_global_upperbound
373 | global service_times
374 | global record_profit
375 | global repeat_served
376 | global un_served
377 | global rho
378 |
379 | g_ending_state_vector = [None] * g_number_of_vehicles
380 | repeat_served = []
381 | un_served = []
382 |
383 | path_node_seq = []
384 | path_time_seq = []
385 | service_times = []
386 | record_profit = []
387 |
388 | beam_width = 100
389 |
390 | global_upperbound = 9999999
391 | global_lowerbound = -9999999
392 |
393 | # for updating rho
394 | # key_iter = int(g_number_of_ADMM_iterations / 3)
395 | # key_iter = 50
396 | # primal_slack_in_last_iter = 9999 # initial: a huge number
397 |
398 | # loop for each ADMM iteration
399 | for i in range(g_number_of_ADMM_iterations):
400 | used_v = 0
401 | path_node_seq.append([])
402 | path_time_seq.append([])
403 | service_times.append([0] * g_number_of_nodes)
404 | record_profit.append([])
405 | repeat_served.append([])
406 | un_served.append([])
407 | if i != 0:
408 | service_times[i] = service_times[i - 1]
409 | print(f"ADMM Iteration no = {i}")
410 |
411 | # Calculate_upper_bound(i)
412 | for v in range(g_number_of_vehicles - 1):
413 | if g_ending_state_vector[v] != None:
414 | for n in range(1, g_number_of_nodes - 1):
415 | service_times[i][n] -= g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
416 | for n in range(1, g_number_of_nodes - 1):
417 | g_node_list[n].base_profit_for_admm = g_node_list[n].base_profit_for_lr + (1 - 2 * service_times[i][n]) * rho / 2.0
418 |
419 | g_time_dependent_dynamic_programming(v, origin_node, departure_time_beginning, destination_node, arrival_time_ending, beam_width, 0)
420 |
421 | ADMM_local_upperbound[i] += g_ending_state_vector[v].m_VSStateVector[0].primal_label_cost
422 | path_node_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_node_sequence)
423 | path_time_seq[i].append(g_ending_state_vector[v].m_VSStateVector[0].m_visit_time_sequence)
424 |
425 | for n in range(1, g_number_of_nodes - 1):
426 | service_times[i][n] += g_ending_state_vector[v].m_VSStateVector[0].passenger_service_state[n]
427 | if len(path_node_seq[i][v]) != 2:
428 | used_v += 1
429 |
430 | # primal_slack = 0
431 | for n in range(1, g_number_of_nodes - 1):
432 | if service_times[i][n] > 1:
433 | repeat_served[i].append(n)
434 | # primal_slack += (service_times[i][n] - 1) ** 2
435 | if service_times[i][n] == 0:
436 | un_served[i].append(n)
437 | # primal_slack += 1
438 | ADMM_local_upperbound[i] = ADMM_local_upperbound[i] + 400
439 | record_profit[i].append(g_node_list[n].base_profit_for_lr)
440 |
441 | # Calculate_lower_bound(i)
442 | g_time_dependent_dynamic_programming(g_number_of_vehicles - 1, origin_node, departure_time_beginning, destination_node, arrival_time_ending, beam_width, 1)
443 |
444 | for vv in range(g_number_of_vehicles - 1):
445 | ADMM_local_lowerbound[i] = ADMM_local_lowerbound[i] + min(g_ending_state_vector[g_number_of_vehicles - 1].m_VSStateVector[vv].label_cost_for_lr, 0) # v shortest paths
446 | for n in range(1, g_number_of_nodes - 1):
447 | ADMM_local_lowerbound[i] = ADMM_local_lowerbound[i] + g_node_list[n].base_profit_for_lr
448 |
449 | # self-adaptive updating the quadratic penalty parameter : rho
450 | # the following implementation is modified based on Dr. Yu Yao
451 | if i >= 50:
452 | if (len(un_served[i]) + len(repeat_served[i])) ** 2 > 0.25 * (len(un_served[i - 1]) + len(repeat_served[i - 1])) ** 2:
453 | rho += 2
454 | if (len(un_served[i]) + len(repeat_served[i])) ** 2 == 0:
455 | rho = 1
456 |
457 | ## update rho, implemented by Chongnan Li, which is more consistent with the Part B paper
458 | # if i >= key_iter:
459 | # if primal_slack > 0.25 * primal_slack_in_last_iter:
460 | # rho += 2
461 | # if primal_slack == 0:
462 | # rho = 1
463 | # primal_slack_in_last_iter = primal_slack
464 |
465 | for n in range(1, g_number_of_nodes - 1):
466 | g_node_list[n].base_profit_for_lr = g_node_list[n].base_profit_for_lr + (1 - service_times[i][n]) * rho
467 |
468 | if global_upperbound > ADMM_local_upperbound[i]:
469 | global_upperbound = ADMM_local_upperbound[i]
470 | if global_lowerbound < ADMM_local_lowerbound[i]:
471 | global_lowerbound = ADMM_local_lowerbound[i]
472 | ADMM_global_upperbound[i] = global_upperbound
473 | ADMM_global_lowerbound[i] = global_lowerbound
474 |
475 | rel_gap = (global_upperbound - global_lowerbound) / global_upperbound
476 | if rel_gap < gap_threshold and len(repeat_served[i]) == 0 and len(un_served[i]) == 0:
477 | i += 1
478 | print("gap threshold satisfied, terminate ADMM")
479 | print(f"gap = {rel_gap * 100} %")
480 | print(f"obj value = {global_upperbound}")
481 | return i
482 |
483 | print("max iter num reached, terminate ADMM")
484 | print(f"gap = {rel_gap * 100} %")
485 | print(f"obj value = {global_upperbound}")
486 | return g_number_of_ADMM_iterations
487 |
488 |
489 | if __name__ == '__main__':
490 | gap_threshold = 0.075 # 7.5%
491 |
492 | vehicle_fleet_size = 16
493 | g_number_of_time_intervals = 960
494 | fixed_cost = 200
495 | waiting_arc_cost = 0.4
496 | service_length = 30
497 |
498 | origin_node = 0
499 | departure_time_beginning = 0
500 | destination_node = 100
501 | arrival_time_ending = 960
502 |
503 | g_number_of_ADMM_iterations = 200
504 |
505 | _MAX_LABEL_COST = 100000
506 |
507 | g_node_list = []
508 | g_link_list = []
509 | g_agent_list = []
510 |
511 | g_number_of_nodes = 0
512 | g_number_of_customers = 0
513 | g_number_of_links = 0
514 | g_number_of_vehicles = 0
515 |
516 | base_profit = 150
517 | rho = 1
518 |
519 | g_ending_state_vector = [None] * g_number_of_vehicles
520 |
521 | path_node_seq = []
522 | path_time_seq = []
523 | service_times = []
524 | record_profit = []
525 |
526 | beam_width = 100
527 |
528 | global_upperbound = 999999
529 | global_lowerbound = -999999
530 | ADMM_global_lowerbound = [0] * g_number_of_ADMM_iterations
531 | ADMM_global_upperbound = [0] * g_number_of_ADMM_iterations
532 | ADMM_local_lowerbound = [0] * g_number_of_ADMM_iterations
533 | ADMM_local_upperbound = [0] * g_number_of_ADMM_iterations
534 |
535 | print('Reading data......')
536 | g_read_input_data()
537 | time_start = time.time()
538 |
539 | num_iter = g_alternating_direction_method_of_multipliers()
540 |
541 | time_end = time.time()
542 | f = open("./output/output_path.csv", "w")
543 | f.write("iteration,vehicle_id,path_node_seq,path_time_seq\n")
544 | for i in range(num_iter):
545 | for v in range(g_number_of_vehicles - 1):
546 | f.write(str(i) + ",")
547 | f.write(str(v) + ",")
548 | str1 = ""
549 | str2 = ""
550 | for s in range(len(path_node_seq[i][v])):
551 | str1 = str1 + str(path_node_seq[i][v][s]) + "_"
552 | str2 = str2 + str(path_time_seq[i][v][s]) + "_"
553 | f.write(str1 + "," + str2 + "\n")
554 | f.close()
555 |
556 | f = open("./output/output_profit.csv", "w")
557 | f.write("iteration,")
558 | for n in range(1, g_number_of_customers + 1):
559 | f.write(str(n) + ",")
560 | f.write("\n")
561 | for i in range(num_iter):
562 | f.write(str(i) + ",")
563 | for n in range(g_number_of_customers):
564 | f.write(str(record_profit[i][n]) + ",")
565 | f.write("\n")
566 | f.close()
567 |
568 | f = open("./output/output_gap.csv", "w")
569 | f.write("iteration,loc_LB,loc_UB,glob_LB,glob_UB,repeated_services,missed_services \n")
570 | for i in range(num_iter):
571 | f.write(str(i) + ",")
572 | f.write(str(ADMM_local_lowerbound[i]) + ",")
573 | f.write(str(ADMM_local_upperbound[i]) + ",")
574 | f.write(str(ADMM_global_lowerbound[i]) + ",")
575 | f.write(str(ADMM_global_upperbound[i]) + ",")
576 | for j in repeat_served[i]:
577 | f.write(str(j) + ";")
578 | f.write(",")
579 | for k in un_served[i]:
580 | f.write(str(k) + ";")
581 | f.write("\n")
582 | f.close()
583 |
584 | print('time cost', time_end - time_start)
585 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/input/input_node_100.csv:
--------------------------------------------------------------------------------
1 | ID,type,lng,lat,pack_total_weight,pack_total_volume,first_receive_tm,last_receive_tm
2 | 1,2,116.242043,40.07263,0.2076,0.3666,60,240
3 | 2,2,116.403595,39.872945,0.05863,0.1687,330,360
4 | 3,2,116.186289,40.016361,0.03645,0.0745,300,420
5 | 4,2,116.508011,39.826296,0.02595,0.0542,60,120
6 | 5,2,116.130997,39.825921,0.0198,0.1117,180,330
7 | 6,2,116.292094,39.942186,0.02653,0.0409,210,300
8 | 7,2,116.439797,39.833047,0.06097,0.1057,60,180
9 | 8,2,116.508963,39.82386,0.01075,0.0455,300,420
10 | 9,2,116.378689,39.795018,0.221895,0.3375,60,240
11 | 10,2,116.358365,39.922532,0.025,0.2034,300,360
12 | 11,2,116.373796,39.865785,0.051942,0.1037,330,450
13 | 12,2,116.183008,40.161382,0.04723,0.0964,330,450
14 | 13,2,116.160112,40.04781,0.692255,1.1219,330,360
15 | 14,2,116.678619,39.847616,0.01055,0.026,120,240
16 | 15,2,116.226258,39.713316,0.0505,0.1151,180,240
17 | 16,2,116.306948,40.099512,0.348,3.4027,90,180
18 | 17,2,116.408698,39.766474,0.4524,4.4235,120,180
19 | 18,2,116.333278,39.851693,0.518445,1.4488,90,150
20 | 19,2,116.197001,40.11375,0.0208,0.1346,300,360
21 | 20,2,116.40678,40.151046,0.0886,0.1477,60,120
22 | 21,2,116.14471,39.969706,0.02865,0.0513,60,240
23 | 22,2,116.129614,39.81306,0.0105,0.0386,120,180
24 | 23,2,116.643754,40.01394,0.0856,0.1566,300,390
25 | 24,2,116.296372,39.837049,0.03304,0.1331,330,450
26 | 25,2,116.447047,40.008081,0.02366,0.3351,60,240
27 | 26,2,116.276963,40.15864,0.08944,0.1272,120,240
28 | 27,2,116.354563,39.866296,0.015,0.3662,330,450
29 | 28,2,116.318031,39.875112,0.03798,0.051,330,450
30 | 29,2,116.425587,39.865789,0.02212,0.798,330,360
31 | 30,2,116.471535,39.96689,0.24,0.4176,120,180
32 | 31,2,116.499245,40.007637,0.013,0.0368,90,180
33 | 32,2,116.319851,39.936628,0.3153,0.6039,180,240
34 | 33,2,116.440667,39.923044,0.1716,0.4511,330,360
35 | 34,2,116.205883,39.758115,0.04826,0.1466,180,330
36 | 35,2,116.443684,40.084959,0.01467,0.1156,120,180
37 | 36,2,116.529238,39.912863,0.0124,0.159,120,240
38 | 37,2,116.638334,39.814205,0.01817,0.0293,180,300
39 | 38,2,116.352196,39.720231,0.06247,0.121,300,360
40 | 39,2,116.21816,40.163925,0.0202,0.0515,60,240
41 | 40,2,116.402014,39.854453,0.0106,0.0244,180,330
42 | 41,2,116.447673,39.907295,0.06498,0.4311,300,360
43 | 42,2,116.504712,40.07421,0.0135,0.0942,90,150
44 | 43,2,116.536107,39.8698,0.012,0.0573,300,450
45 | 44,2,116.674032,39.980487,0.0129,0.0973,300,450
46 | 45,2,116.421084,39.869937,0.012,0.0837,60,180
47 | 46,2,116.326513,39.969071,0.02331,0.0956,300,420
48 | 47,2,116.619257,39.959178,0.36857,0.5909,330,390
49 | 48,2,116.124201,40.044411,0.0294,0.1717,180,330
50 | 49,2,116.330904,40.028102,0.657512,1.0689,300,390
51 | 50,2,116.214509,40.12289,0.01697,0.026,180,240
52 | 51,2,116.17562,40.137607,0.05025,0.262,180,300
53 | 52,2,116.286521,40.040149,0.04702,0.3459,90,150
54 | 53,2,116.547921,40.099246,0.56436,0.878,300,360
55 | 54,2,116.426204,39.768165,0.05526,0.0875,120,180
56 | 55,2,116.19866,39.916869,0.09815,0.2089,300,450
57 | 56,2,116.401042,40.12821,0.013164,0.1085,210,300
58 | 57,2,116.526786,39.772772,0.0878,0.9089,90,180
59 | 58,2,116.509573,39.903943,0.03786,0.3001,60,240
60 | 59,2,116.619958,40.01825,0.0348,0.2074,120,180
61 | 60,2,116.288546,39.947152,0.0252,0.0265,120,240
62 | 61,2,116.358599,40.049618,0.0288,0.1882,90,150
63 | 62,2,116.185684,40.041983,0.0181,0.103,90,240
64 | 63,2,116.56718,39.922132,0.021,0.1357,180,330
65 | 64,2,116.454199,39.823758,0.0108,0.0612,210,300
66 | 65,2,116.315443,40.149423,0.0134,0.1608,300,420
67 | 66,2,116.69749,39.969033,0.0164,0.1584,330,390
68 | 67,2,116.129775,40.030684,0.04008,0.1237,90,150
69 | 68,2,116.135035,39.829379,0.20093,0.295,330,450
70 | 69,2,116.157269,39.81385,0.22901,0.3757,300,360
71 | 70,2,116.108275,39.961533,0.03329,0.0594,90,150
72 | 71,2,116.69369,39.977631,0.02872,0.0458,210,300
73 | 72,2,116.31828,40.011351,0.02904,0.0432,180,240
74 | 73,2,116.551723,40.137788,0.0526,0.06,180,240
75 | 74,2,116.519285,39.975288,0.3765,0.253,330,450
76 | 75,2,116.278044,40.020899,0.01908,0.0726,330,420
77 | 76,2,116.283233,39.997765,0.02112,0.04,330,420
78 | 77,2,116.239449,40.166236,0.0336,0.062,300,420
79 | 78,2,116.705558,39.98208,0.010625,0.0402,180,240
80 | 79,2,116.325359,39.714637,0.06506,0.0767,180,300
81 | 80,2,116.297954,39.749617,0.03432,0.0902,300,390
82 | 81,2,116.442283,39.955037,0.15,0.2468,120,240
83 | 82,2,116.344187,39.928046,0.05758,0.0716,300,360
84 | 83,2,116.39675,40.032799,0.01536,0.0445,300,450
85 | 84,2,116.343961,39.731958,0.0786,0.6139,180,300
86 | 85,2,116.422325,39.937723,0.024,0.05,210,300
87 | 86,2,116.50139,39.940665,0.492,0.903,330,450
88 | 87,2,116.18186,39.877509,0.152,0.315,330,450
89 | 88,2,116.702389,39.98513,0.3596,3.5161,60,240
90 | 89,2,116.276227,39.95463,0.15171,0.2329,330,360
91 | 90,2,116.327119,39.983674,0.0204,0.0621,330,450
92 | 91,2,116.636276,40.029454,0.03772,0.3039,300,390
93 | 92,2,116.486264,39.755984,0.04418,0.3643,210,300
94 | 93,2,116.443102,39.902115,0.09197,0.6076,210,330
95 | 94,2,116.452477,39.766004,0.08526,0.3598,330,360
96 | 95,2,116.368884,39.750008,0.073,0.2659,330,390
97 | 96,2,116.267044,40.005218,0.0238,0.1072,330,390
98 | 97,2,116.39372,39.932944,0.427,0.6515,180,300
99 | 98,2,116.356651,40.0132,0.1095,1.0035,60,240
100 | 99,2,116.563261,39.920876,0.0108,0.0178,210,330
101 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/OutputLog.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/OutputLog.docx
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/output_gap.csv:
--------------------------------------------------------------------------------
1 | iteration,loc_LB,loc_UB,glob_LB,glob_UB,repeated_services,missed_services
2 | 0,14850,39600.18,14850,39600.18,,1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;
3 | 1,14949,39600.18,14949,39600.18,,1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;
4 | 2,15048,39600.18,15048,39600.18,,1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;
5 | 3,15147,39600.18,15147,39600.18,,1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;
6 | 4,15246,37144.756,15246,37144.756,,1;2;3;5;6;7;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;47;48;49;50;51;52;53;54;55;56;57;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
7 | 5,15335,37146.831999999995,15335,37144.756,,1;2;3;5;6;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
8 | 6,15424,37144.756,15424,37144.756,,1;2;3;5;6;7;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;47;48;49;50;51;52;53;54;55;56;57;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
9 | 7,15513,37146.831999999995,15513,37144.756,,1;2;3;5;6;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
10 | 8,15600.588,37144.756,15600.588,37144.756,,1;2;3;5;6;7;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;47;48;49;50;51;52;53;54;55;56;57;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
11 | 9,15688.664,35377.432,15688.664,35377.432,40;,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;32;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;55;56;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
12 | 10,15766.588,34975.356,15766.588,34975.356,,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;33;34;35;36;37;38;39;41;42;43;44;45;47;48;49;50;51;52;53;55;56;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
13 | 11,15846.588,35722.007999999994,15846.588,34975.356,4;10;40;46;82;85;90;97;,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;55;56;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
14 | 12,15917.044,33377.38799999999,15917.044,33377.38799999999,4;58;,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;34;35;37;38;39;42;44;45;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
15 | 13,15989.044,35032.812000000005,15989.044,33377.38799999999,,1;3;5;6;7;8;10;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;32;34;35;37;38;39;42;44;45;46;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;87;88;89;90;91;92;94;95;96;97;98;
16 | 14,16064.707999999999,35893.439999999995,16064.707999999999,33377.38799999999,4;10;46;58;82;85;90;97;,1;2;3;5;6;8;9;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;31;32;34;35;37;38;39;42;44;47;48;49;50;51;52;53;54;55;56;57;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
17 | 15,16135.612000000001,35032.812000000005,16135.612000000001,33377.38799999999,,1;3;5;6;7;8;10;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;32;34;35;37;38;39;42;44;45;46;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;87;88;89;90;91;92;94;95;96;97;98;
18 | 16,16211.276,33379.46399999999,16211.276,33377.38799999999,4;40;,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;32;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;83;84;87;88;89;91;92;94;95;96;98;
19 | 17,16283.2,33377.38799999999,16283.2,33377.38799999999,4;58;,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;34;35;37;38;39;42;44;45;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
20 | 18,16353.276,34984.10400000001,16353.276,33377.38799999999,,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;32;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;55;56;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;96;98;99;
21 | 19,16425.792,32454.672,16425.792,32454.672,4;7;45;97;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;87;88;91;92;94;95;98;
22 | 20,16493.244,33377.38799999999,16493.244,32454.672,4;58;,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;34;35;37;38;39;42;44;45;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
23 | 21,16563.203999999998,32045.924,16563.203999999998,32045.924,4;58;97;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;87;88;91;92;94;95;98;
24 | 22,16627.868000000002,33321.056,16627.868000000002,32045.924,4;,1;3;5;8;10;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;34;35;37;38;39;42;44;46;47;48;49;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;81;82;83;84;85;87;88;90;91;92;94;95;97;98;
25 | 23,16696.748,34072.348,16696.748,32045.924,4;7;45;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;55;56;58;59;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;86;87;88;91;92;93;94;95;98;99;
26 | 24,16762.244,33377.38799999999,16762.244,32045.924,4;58;,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;32;34;35;37;38;39;42;44;45;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
27 | 25,16832.5,31665.631999999998,16832.5,31665.631999999998,4;58;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;87;88;91;92;94;95;98;
28 | 26,16899.868000000002,31665.631999999998,16899.868000000002,31665.631999999998,4;58;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;87;88;91;92;94;95;98;
29 | 27,16962.612,33321.056,16962.612,31665.631999999998,4;,1;3;5;8;10;12;13;14;15;16;18;19;20;21;22;23;24;25;26;29;30;31;34;35;37;38;39;42;44;46;47;48;49;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;81;82;83;84;85;87;88;90;91;92;94;95;97;98;
30 | 28,17031.2,32947.691999999995,17031.2,31665.631999999998,,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;26;29;30;32;33;34;35;36;37;38;39;41;42;43;44;47;48;50;51;52;53;55;56;59;60;61;62;63;64;65;66;67;68;69;70;71;73;74;77;78;79;80;83;84;86;87;88;89;91;92;93;94;95;99;
31 | 29,17094.5,30820.647999999997,17094.5,30820.647999999997,4;17;54;57;58;,1;3;5;8;12;13;14;15;16;18;19;20;21;22;23;25;26;29;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;83;88;91;92;94;95;98;
32 | 30,17155.844,31349.724,17155.844,30820.647999999997,4;58;,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;26;29;30;32;34;35;37;38;39;42;44;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;79;80;83;84;87;88;89;91;92;94;95;
33 | 31,17214.896,29634.336000000007,17214.896,29634.336000000007,4;17;54;57;58;76;96;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;26;29;34;35;37;38;39;42;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;88;91;92;94;95;
34 | 32,17263.256,33038.115999999995,17263.256,29634.336000000007,,1;2;3;5;8;9;11;12;13;14;15;16;19;20;21;22;23;25;26;27;28;29;31;33;34;35;36;37;38;39;40;41;42;43;44;47;48;49;50;51;52;53;56;59;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;77;78;83;86;88;91;92;93;94;95;98;99;
35 | 33,17324.256,31289.76,17324.256,29634.336000000007,17;54;57;58;76;96;,1;3;5;8;10;12;13;14;15;16;19;20;21;22;23;26;29;30;34;35;37;38;39;42;44;46;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;81;82;83;85;88;90;91;92;94;95;97;
36 | 34,17378.311999999998,31349.723999999995,17378.311999999998,29634.336000000007,4;58;,1;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;26;29;30;32;34;35;37;38;39;42;44;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;79;80;83;84;87;88;89;91;92;94;95;
37 | 35,17438.095999999998,30043.084000000006,17438.095999999998,29634.336000000007,4;7;17;45;54;57;58;76;96;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;26;29;30;34;35;37;38;39;42;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;88;91;92;94;95;
38 | 36,17490.588,31440.147999999997,17490.588,29634.336000000007,4;58;,1;2;3;5;8;9;11;12;13;14;15;16;19;20;21;22;23;25;26;27;28;29;31;34;35;37;38;39;40;42;44;47;48;49;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;83;88;91;92;94;95;98;
39 | 37,17548.212,31247.372000000003,17548.212,29634.336000000007,4;7;11;17;27;28;45;54;57;58;76;96;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;26;30;33;34;35;37;38;39;41;42;43;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;86;88;91;92;94;95;
40 | 38,17596,31740.976,17596,29634.336000000007,4;58;,1;3;5;6;7;8;12;13;14;15;16;18;19;20;21;22;23;24;26;29;32;34;35;37;38;39;42;44;45;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;79;80;83;84;87;88;89;91;92;94;95;
41 | 39,17652.384,33846.864,17652.384,29634.336000000007,7;45;,1;2;3;5;8;9;11;12;13;14;15;16;19;20;21;22;23;25;26;27;28;29;30;31;33;34;35;36;37;38;39;40;41;42;43;44;47;48;49;50;51;52;53;56;58;59;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;77;78;83;86;88;91;92;93;94;95;98;99;
42 | 40,17713.876,31315.352,17713.876,29634.336000000007,17;54;57;58;76;96;,1;2;3;5;8;10;12;13;14;15;16;19;20;21;22;23;26;30;34;35;37;38;39;42;44;46;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;81;82;83;85;88;90;91;92;94;95;97;
43 | 41,17769.564,29634.336000000003,17769.564,29634.336000000003,4;17;54;57;58;76;96;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;26;29;34;35;37;38;39;42;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;88;91;92;94;95;
44 | 42,17820.712,33011.727999999996,17820.712,29634.336000000003,4;,1;2;3;5;6;8;12;13;14;15;16;18;19;20;21;22;23;24;25;26;30;31;32;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;83;84;87;88;89;91;92;94;95;96;98;
45 | 43,17886.216,29634.336000000003,17886.216,29634.336000000003,4;17;54;57;58;76;96;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;26;29;34;35;37;38;39;42;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;88;91;92;94;95;
46 | 44,17935.356,31016.771999999997,17935.356,29634.336000000003,4;7;45;58;76;96;,1;2;3;5;8;9;12;13;14;15;16;19;20;21;22;23;26;30;33;34;35;37;38;39;40;41;42;43;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;86;88;91;92;94;95;
47 | 45,17988.564,31490.003999999997,17988.564,29634.336000000003,4;58;,1;2;3;5;6;8;9;11;12;13;14;15;16;18;19;20;21;22;23;26;27;28;29;30;32;34;35;37;39;42;44;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;81;83;87;88;89;91;92;94;
48 | 46,18041.56,32068.715999999997,18041.56,29634.336000000003,17;54;57;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;25;26;29;31;33;34;35;36;37;38;39;41;42;43;44;47;48;49;50;51;52;53;56;59;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;77;78;83;86;88;91;92;93;94;95;98;99;
49 | 47,18101.732,31337.888,18101.732,29634.336000000003,17;54;57;58;76;96;,1;2;3;5;8;10;12;13;14;15;16;19;20;21;22;23;26;30;34;35;37;39;42;44;46;47;48;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;81;82;83;85;87;88;90;91;92;94;97;
50 | 48,18154.32,31315.731999999996,18154.32,29634.336000000003,4;58;,1;3;5;8;12;13;14;15;16;19;20;21;22;23;24;25;26;29;31;34;35;37;38;39;42;44;47;48;49;50;51;52;53;55;56;59;61;62;64;65;66;67;68;69;70;71;72;73;74;75;77;78;79;80;83;84;87;88;91;92;94;95;98;
51 | 49,18210.904000000002,29659.928000000007,18210.904000000002,29634.336000000003,4;17;54;57;58;76;96;,1;2;3;5;8;12;13;14;15;16;19;20;21;22;23;26;34;35;37;38;39;42;44;47;48;50;51;52;53;56;59;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;88;91;92;94;95;
52 | 50,18265.5,31496.675999999996,18265.5,29634.336000000003,4;58;,1;2;3;5;6;8;9;11;12;13;14;15;16;18;19;20;21;22;23;26;27;28;29;30;32;34;35;37;39;40;42;44;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;83;87;88;89;91;92;94;
53 | 51,18386.376,32787.884000000005,18386.376,29634.336000000003,4;6;7;11;14;17;18;27;28;32;43;44;45;47;54;57;58;60;66;71;76;78;88;89;,1;3;5;8;12;13;15;16;19;20;21;22;23;25;26;31;33;34;35;37;38;39;41;42;48;49;50;51;52;53;56;59;61;62;64;65;67;68;69;70;72;73;74;77;83;86;91;92;94;95;98;
54 | 52,18574.6,31781.512,18574.6,29634.336000000003,4;58;,1;2;3;5;6;9;11;12;13;14;15;16;18;19;20;21;22;23;26;27;28;30;32;33;34;35;37;39;42;43;44;47;48;50;51;52;53;55;56;59;60;61;62;64;65;66;67;68;69;70;71;73;74;77;78;81;83;86;87;88;89;91;92;94;
55 | 53,18918.808,28360.844000000005,18918.808,28360.844000000005,4;9;17;18;43;55;58;68;69;87;96;,1;2;8;12;13;16;19;20;21;23;24;26;35;37;38;39;40;42;48;50;51;52;53;56;59;61;62;65;67;70;73;74;77;80;83;84;91;94;95;
56 | 54,19166.052,28862.936,19166.052,28360.844000000005,17;54;57;,5;8;9;12;15;16;19;20;21;22;23;25;26;29;31;33;34;35;36;37;39;41;42;49;50;51;53;56;59;63;65;67;68;69;70;72;73;74;77;83;86;87;91;92;93;94;96;99;
57 | 55,19521.764,29976.380000000005,19521.764,28360.844000000005,4;7;17;25;29;31;41;43;44;45;55;58;64;71;76;78;88;93;96;98;,2;10;12;16;19;20;21;22;24;26;30;35;37;38;39;42;46;50;51;53;56;65;67;69;70;73;77;80;81;82;83;84;85;90;94;95;97;
58 | 56,19804.612,26442.600000000006,19804.612,26442.600000000006,9;18;46;90;,1;7;8;13;15;20;21;29;34;35;42;45;47;48;49;50;52;53;56;59;62;65;66;67;70;72;73;77;83;89;92;94;96;
59 | 57,20051.98,27192.459999999992,20051.98,26442.600000000006,3;7;8;13;17;25;40;45;55;57;64;79;98;,5;6;12;18;20;21;22;23;26;32;33;39;42;43;53;56;59;60;65;67;70;73;77;83;86;89;91;
60 | 58,20218.452,28214.047999999995,20218.452,26442.600000000006,4;6;7;12;18;19;32;45;46;51;58;60;61;77;90;93;98;,2;3;8;13;15;20;21;25;34;37;40;47;48;53;59;62;64;65;66;67;70;72;73;76;92;94;97;
61 | 59,20514.272,25849.615999999995,20514.272,25849.615999999995,31;37;43;47;64;71;78;88;,4;10;16;21;22;29;36;53;58;63;67;70;72;73;75;82;93;99;
62 | 60,20327.572,24676.759999999995,20514.272,24676.759999999995,3;4;13;36;41;57;58;63;75;93;99;,12;16;21;23;25;53;59;65;67;70;72;77;91;92;94;
63 | 61,20626.588,25335.503999999994,20626.588,24676.759999999995,12;31;37;51;64;65;74;77;,1;3;13;14;19;20;29;43;47;50;52;53;66;70;72;
64 | 62,20720.404,26619.907999999992,20720.404,24676.759999999995,8;21;25;38;43;47;51;71;78;84;88;97;,6;7;15;16;20;26;33;34;37;45;53;56;61;64;73;74;83;89;
65 | 63,20798.896,29816.107999999997,20798.896,24676.759999999995,3;5;6;13;31;35;42;55;61;64;68;73;83;87;92;98;,2;9;12;17;18;24;25;32;33;38;41;47;57;58;63;65;66;67;77;80;84;93;95;97;99;
66 | 64,20589.332000000002,27611.543999999994,20798.896,24676.759999999995,7;9;12;17;26;32;36;41;45;57;63;65;75;76;77;81;93;96;97;99;,1;5;22;23;31;42;52;53;60;61;73;83;91;92;94;98;
67 | 65,20700.348,26414.623999999996,20798.896,24676.759999999995,38;52;61;74;84;86;90;92;98;,7;9;16;17;18;22;29;32;45;47;69;75;76;96;
68 | 66,20518.528,25857.327999999994,20798.896,24676.759999999995,5;9;18;22;23;80;91;,2;15;20;26;33;39;41;52;53;61;72;74;86;92;93;98;
69 | 67,20518.768,26186.383999999995,20798.896,24676.759999999995,6;7;41;43;50;52;54;61;72;74;76;86;89;92;93;96;98;,5;9;18;22;23;91;94;
70 | 68,20849.708,25317.352,20849.708,24676.759999999995,5;9;22;23;26;34;39;75;80;83;91;,1;29;32;79;
71 | 69,20784.108,24330.124,20849.708,24330.124,8;9;20;,2;5;22;23;24;38;59;60;80;84;91;95;
72 | 70,20679.095999999998,26540.091999999993,20849.708,24330.124,2;11;17;24;25;27;28;38;58;79;80;84;95;,5;9;14;22;29;44;61;66;72;76;89;94;96;98;
73 | 71,20139.948,27136.548,20849.708,24330.124,5;6;9;14;22;34;44;60;66;71;78;88;92;94;,2;17;25;26;38;39;53;54;57;79;80;84;
74 | 72,19946.192000000003,25644.788,20849.708,24330.124,6;16;17;32;38;54;57;61;79;84;98;,2;20;21;30;44;49;52;56;66;67;70;81;85;92;97;
75 | 73,19619.068,26296.487999999998,20849.708,24330.124,21;30;36;44;49;66;70;81;85;96;97;,6;9;15;16;18;32;34;35;53;60;80;89;95;
76 | 74,20198.52,25800.339999999997,20849.708,24330.124,3;9;10;11;13;18;24;32;35;45;48;60;62;97;,43;44;51;66;96;
77 | 75,19807.167999999998,26413.228000000003,20849.708,24330.124,16;25;26;37;44;52;53;66;72;76;91;,6;10;11;18;29;60;
78 | 76,20221.288,24735.507999999998,20849.708,24330.124,6;43;49;56;60;83;,3;13;16;25;44;45;48;53;66;70;82;
79 | 77,20371.552,24836.28,20849.708,24330.124,3;8;13;20;48;60;,10;46;49;56;75;83;90;
80 | 78,20207.584,24338.552,20849.708,24330.124,7;25;32;45;46;82;83;90;,14;37;43;76;91;94;
81 | 79,20126.272,25417.239999999998,20849.708,24330.124,1;29;43;49;64;72;75;92;95;,3;13;18;21;32;33;47;48;89;
82 | 80,19360.363999999998,26819.783999999992,20849.708,24330.124,18;21;32;47;48;67;70;76;89;,1;7;20;25;45;49;55;56;64;82;83;92;94;
83 | 81,19532.608,25067.904,20849.708,24330.124,3;16;25;55;64;92;94;,26;32;33;47;75;76;89;96;
84 | 82,19597.884,23218.147999999997,20849.708,23218.147999999997,32;39;50;,10;25;91;
85 | 83,19318.023999999998,24625.803999999996,20849.708,23218.147999999997,20;23;25;26;91;,50;64;82;92;94;98;
86 | 84,19971.528,22639.523999999998,20849.708,22639.523999999998,32;98;,23;29;91;
87 | 85,19961.384,25326.368000000002,20849.708,22639.523999999998,10;14;23;37;59;64;85;91;,2;36;41;61;72;93;98;
88 | 86,19425.275999999998,24607.095999999998,20849.708,22639.523999999998,31;41;61;89;93;94;98;,10;20;23;33;59;65;91;97;
89 | 87,19702.688,25822.287999999997,20849.708,22639.523999999998,10;20;23;40;50;56;65;91;97;,25;31;32;37;64;94;
90 | 88,19927.843999999997,24235.019999999997,20849.708,22639.523999999998,25;33;37;64;72;76;96;,23;50;56;91;
91 | 89,19619.472,24483.095999999998,20849.708,22639.523999999998,18;23;59;91;,9;22;61;72;76;98;
92 | 90,19109.440000000002,24653.631999999998,20849.708,22639.523999999998,9;15;22;34;61;80;94;,20;23;25;33;65;72;91;
93 | 91,18343.82,26478.575999999994,20849.708,22639.523999999998,1;20;25;32;33;52;53;56;65;72;74;86;,24;80;92;95;
94 | 92,19944.248,25272.747999999996,20849.708,22639.523999999998,23;24;91;92;95;,7;18;32;52;53;74;79;86;96;
95 | 93,19614.772,24902.324,20849.708,22639.523999999998,7;18;22;38;53;72;75;79;84;,23;34;91;92;
96 | 94,19946.792,24780.636,20849.708,22639.523999999998,19;23;51;63;82;91;99;,9;22;32;43;53;89;
97 | 95,19722.212,24118.127999999997,20849.708,22639.523999999998,5;21;43;56;89;,23;60;91;
98 | 96,19277.116,26210.992,20849.708,22639.523999999998,9;18;32;47;60;91;92;,25;37;46;63;64;72;82;90;97;99;
99 | 97,18640.984,25622.939999999995,20849.708,22639.523999999998,37;46;64;72;76;89;90;96;97;98;,18;19;43;47;56;71;78;88;
100 | 98,18526.396,25069.744000000002,20849.708,22639.523999999998,19;25;43;47;71;78;82;88;,20;21;26;39;58;85;89;97;
101 | 99,18317.5,25130.872000000003,20849.708,22639.523999999998,20;23;26;53;56;58;85;,19;51;59;66;82;99;
102 | 100,18111.968,24151.68,20849.708,22639.523999999998,10;63;82;97;99;,23;25;56;61;91;98;
103 | 101,18445.856,24143.268,20849.708,22639.523999999998,23;25;31;83;91;,10;82;97;
104 | 102,18673.768,24755.448,20849.708,22639.523999999998,30;32;81;82;,16;20;26;31;49;75;76;83;96;
105 | 103,16021.612000000001,25294.643999999997,20849.708,22639.523999999998,16;26;31;49;96;98;,32;37;38;64;65;79;84;95;
106 | 104,19184.34,25169.856,20849.708,22639.523999999998,32;37;61;64;79;95;,5;22;30;46;81;82;85;90;
107 | 105,18179.128,24240.671999999995,20849.708,22639.523999999998,5;19;22;46;51;82;90;,23;61;72;91;
108 | 106,18665.236,25070.388,20849.708,22639.523999999998,23;35;42;56;59;65;89;91;,19;51;
109 | 107,18562.696,23749.007999999998,20849.708,22639.523999999998,16;33;51;61;,23;56;91;
110 | 108,18635.796000000002,24618.016,20849.708,22639.523999999998,2;20;23;50;91;,31;35;42;51;53;73;
111 | 109,17497.208,24453.752,20849.708,22639.523999999998,29;53;73;97;,25;49;50;65;
112 | 110,17366.016,25259.415999999997,20849.708,22639.523999999998,25;31;36;42;49;65;73;83;85;,16;20;26;46;59;90;
113 | 111,17023.208,26693.544,20849.708,22639.523999999998,10;20;26;39;46;50;72;75;76;90;,31;32;61;73;83;85;89;97;98;
114 | 112,19502.248,25337.232,20849.708,22639.523999999998,59;61;73;85;97;98;,6;18;20;26;50;60;65;
115 | 113,17494.524,26440.624,20849.708,22639.523999999998,6;7;20;26;50;60;65;89;,25;35;42;46;59;72;75;76;96;98;
116 | 114,17028.608,24451.471999999998,20849.708,22639.523999999998,25;35;72;75;96;,7;10;20;39;60;
117 | 115,18845.86,23523.852,20849.708,22639.523999999998,49;76;,6;89;
118 | 116,16884.708000000002,22813.967999999997,20849.708,22639.523999999998,46;,82;
119 | 117,15971.676,22515.736,20849.708,22515.736,,
120 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/plot_output/code_no1/input_node_100.csv:
--------------------------------------------------------------------------------
1 | ID,type,lng,lat,pack_total_weight,pack_total_volume,first_receive_tm,last_receive_tm
2 | 1,2,116.242043,40.07263,0.2076,0.3666,60,240
3 | 2,2,116.403595,39.872945,0.05863,0.1687,330,360
4 | 3,2,116.186289,40.016361,0.03645,0.0745,300,420
5 | 4,2,116.508011,39.826296,0.02595,0.0542,60,120
6 | 5,2,116.130997,39.825921,0.0198,0.1117,180,330
7 | 6,2,116.292094,39.942186,0.02653,0.0409,210,300
8 | 7,2,116.439797,39.833047,0.06097,0.1057,60,180
9 | 8,2,116.508963,39.82386,0.01075,0.0455,300,420
10 | 9,2,116.378689,39.795018,0.221895,0.3375,60,240
11 | 10,2,116.358365,39.922532,0.025,0.2034,300,360
12 | 11,2,116.373796,39.865785,0.051942,0.1037,330,450
13 | 12,2,116.183008,40.161382,0.04723,0.0964,330,450
14 | 13,2,116.160112,40.04781,0.692255,1.1219,330,360
15 | 14,2,116.678619,39.847616,0.01055,0.026,120,240
16 | 15,2,116.226258,39.713316,0.0505,0.1151,180,240
17 | 16,2,116.306948,40.099512,0.348,3.4027,90,180
18 | 17,2,116.408698,39.766474,0.4524,4.4235,120,180
19 | 18,2,116.333278,39.851693,0.518445,1.4488,90,150
20 | 19,2,116.197001,40.11375,0.0208,0.1346,300,360
21 | 20,2,116.40678,40.151046,0.0886,0.1477,60,120
22 | 21,2,116.14471,39.969706,0.02865,0.0513,60,240
23 | 22,2,116.129614,39.81306,0.0105,0.0386,120,180
24 | 23,2,116.643754,40.01394,0.0856,0.1566,300,390
25 | 24,2,116.296372,39.837049,0.03304,0.1331,330,450
26 | 25,2,116.447047,40.008081,0.02366,0.3351,60,240
27 | 26,2,116.276963,40.15864,0.08944,0.1272,120,240
28 | 27,2,116.354563,39.866296,0.015,0.3662,330,450
29 | 28,2,116.318031,39.875112,0.03798,0.051,330,450
30 | 29,2,116.425587,39.865789,0.02212,0.798,330,360
31 | 30,2,116.471535,39.96689,0.24,0.4176,120,180
32 | 31,2,116.499245,40.007637,0.013,0.0368,90,180
33 | 32,2,116.319851,39.936628,0.3153,0.6039,180,240
34 | 33,2,116.440667,39.923044,0.1716,0.4511,330,360
35 | 34,2,116.205883,39.758115,0.04826,0.1466,180,330
36 | 35,2,116.443684,40.084959,0.01467,0.1156,120,180
37 | 36,2,116.529238,39.912863,0.0124,0.159,120,240
38 | 37,2,116.638334,39.814205,0.01817,0.0293,180,300
39 | 38,2,116.352196,39.720231,0.06247,0.121,300,360
40 | 39,2,116.21816,40.163925,0.0202,0.0515,60,240
41 | 40,2,116.402014,39.854453,0.0106,0.0244,180,330
42 | 41,2,116.447673,39.907295,0.06498,0.4311,300,360
43 | 42,2,116.504712,40.07421,0.0135,0.0942,90,150
44 | 43,2,116.536107,39.8698,0.012,0.0573,300,450
45 | 44,2,116.674032,39.980487,0.0129,0.0973,300,450
46 | 45,2,116.421084,39.869937,0.012,0.0837,60,180
47 | 46,2,116.326513,39.969071,0.02331,0.0956,300,420
48 | 47,2,116.619257,39.959178,0.36857,0.5909,330,390
49 | 48,2,116.124201,40.044411,0.0294,0.1717,180,330
50 | 49,2,116.330904,40.028102,0.657512,1.0689,300,390
51 | 50,2,116.214509,40.12289,0.01697,0.026,180,240
52 | 51,2,116.17562,40.137607,0.05025,0.262,180,300
53 | 52,2,116.286521,40.040149,0.04702,0.3459,90,150
54 | 53,2,116.547921,40.099246,0.56436,0.878,300,360
55 | 54,2,116.426204,39.768165,0.05526,0.0875,120,180
56 | 55,2,116.19866,39.916869,0.09815,0.2089,300,450
57 | 56,2,116.401042,40.12821,0.013164,0.1085,210,300
58 | 57,2,116.526786,39.772772,0.0878,0.9089,90,180
59 | 58,2,116.509573,39.903943,0.03786,0.3001,60,240
60 | 59,2,116.619958,40.01825,0.0348,0.2074,120,180
61 | 60,2,116.288546,39.947152,0.0252,0.0265,120,240
62 | 61,2,116.358599,40.049618,0.0288,0.1882,90,150
63 | 62,2,116.185684,40.041983,0.0181,0.103,90,240
64 | 63,2,116.56718,39.922132,0.021,0.1357,180,330
65 | 64,2,116.454199,39.823758,0.0108,0.0612,210,300
66 | 65,2,116.315443,40.149423,0.0134,0.1608,300,420
67 | 66,2,116.69749,39.969033,0.0164,0.1584,330,390
68 | 67,2,116.129775,40.030684,0.04008,0.1237,90,150
69 | 68,2,116.135035,39.829379,0.20093,0.295,330,450
70 | 69,2,116.157269,39.81385,0.22901,0.3757,300,360
71 | 70,2,116.108275,39.961533,0.03329,0.0594,90,150
72 | 71,2,116.69369,39.977631,0.02872,0.0458,210,300
73 | 72,2,116.31828,40.011351,0.02904,0.0432,180,240
74 | 73,2,116.551723,40.137788,0.0526,0.06,180,240
75 | 74,2,116.519285,39.975288,0.3765,0.253,330,450
76 | 75,2,116.278044,40.020899,0.01908,0.0726,330,420
77 | 76,2,116.283233,39.997765,0.02112,0.04,330,420
78 | 77,2,116.239449,40.166236,0.0336,0.062,300,420
79 | 78,2,116.705558,39.98208,0.010625,0.0402,180,240
80 | 79,2,116.325359,39.714637,0.06506,0.0767,180,300
81 | 80,2,116.297954,39.749617,0.03432,0.0902,300,390
82 | 81,2,116.442283,39.955037,0.15,0.2468,120,240
83 | 82,2,116.344187,39.928046,0.05758,0.0716,300,360
84 | 83,2,116.39675,40.032799,0.01536,0.0445,300,450
85 | 84,2,116.343961,39.731958,0.0786,0.6139,180,300
86 | 85,2,116.422325,39.937723,0.024,0.05,210,300
87 | 86,2,116.50139,39.940665,0.492,0.903,330,450
88 | 87,2,116.18186,39.877509,0.152,0.315,330,450
89 | 88,2,116.702389,39.98513,0.3596,3.5161,60,240
90 | 89,2,116.276227,39.95463,0.15171,0.2329,330,360
91 | 90,2,116.327119,39.983674,0.0204,0.0621,330,450
92 | 91,2,116.636276,40.029454,0.03772,0.3039,300,390
93 | 92,2,116.486264,39.755984,0.04418,0.3643,210,300
94 | 93,2,116.443102,39.902115,0.09197,0.6076,210,330
95 | 94,2,116.452477,39.766004,0.08526,0.3598,330,360
96 | 95,2,116.368884,39.750008,0.073,0.2659,330,390
97 | 96,2,116.267044,40.005218,0.0238,0.1072,330,390
98 | 97,2,116.39372,39.932944,0.427,0.6515,180,300
99 | 98,2,116.356651,40.0132,0.1095,1.0035,60,240
100 | 99,2,116.563261,39.920876,0.0108,0.0178,210,330
101 |
--------------------------------------------------------------------------------
/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/plot_output/code_no1/optimal_path.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/ADMM_for_Solomon_and_Jingdong_Refactoring/ADMM_Jingdong/output/plot_output/code_no1/optimal_path.xlsx
--------------------------------------------------------------------------------
/DSSR_ng_route.py:
--------------------------------------------------------------------------------
1 | # coding=gb18030
2 | '''
3 | Author = Yao
4 | '''
5 |
6 | import copy
7 | from read_input import *
8 | import time
9 | import SPPRC
10 |
11 | def isNGRoute(cycles,g_node_dict):
12 | Ng_flag = True
13 | for c in cycles:
14 | Ng_flag_for_this_cycle = False
15 | for i in range(1,len(c)-1):
16 | if c[0] not in g_node_dict[c[i]].ng_set:
17 | Ng_flag_for_this_cycle = True
18 | if Ng_flag_for_this_cycle == False:
19 | Ng_flag = Ng_flag_for_this_cycle
20 | for i in c[1:-1]:
21 | g_node_dict[i].ng_subset.append(c[0])
22 | return Ng_flag
23 |
24 | def find_cycle(path):
25 | cycle=[]
26 | re_path=[]
27 | for i in range(len(path)):
28 | re_path.append(path[len(path)-1-i])
29 | path_elementary = set(path)
30 | for i in path_elementary:
31 | id1=path.index(i)
32 | id2=re_path.index(i)
33 | if id1+id2 !=len(path)-1:
34 | cycle.append(path[id1:(len(path)-id2)])
35 | return cycle
36 |
37 | def generate_completion_bound(thenetwork,veh_cap,T_current):
38 | T = [[float('inf') for i in range(len(thenetwork.nodes)+1)] for j in range(veh_cap + 1)]
39 | T[0][0]=0
40 | for q in range(1,veh_cap):
41 | for i in range(1,len(thenetwork.nodes)+1):
42 | T[q][i] = T_current[q][i]
43 | if T[q-1][i]<=T[q][i]:
44 | T[q][i]= T[q-1][i]
45 | return T
46 |
47 | def DSSR_ng_Route_Algorithm(thenetwork,veh_cap,g_node_dict,g_link_dict,completion_bound_flag,ADMM_flag):
48 | # this completion_bound accerlate technique is only suitable for sysmetric graph
49 | for i in thenetwork.nodes:
50 | g_node_dict[i].ng_subset = []
51 | T = [[float('-inf') for i in range(len(thenetwork.nodes)+1)] for j in range(veh_cap + 1)]
52 | ng = 0
53 | ng_iteration = 1
54 | maintain_columns = 1
55 | while not ng :
56 | new_path, new_path_dual_cost,new_path_primal_cost,T_current = SPPRC.g_optimal_load_dependenet_dynamic_programming(thenetwork,veh_cap,g_node_dict,g_link_dict,T,completion_bound_flag,ADMM_flag,maintain_columns)
57 | if new_path==[]:
58 | return [],[]
59 | ng_path = []
60 | ng_path_dual_cost = []
61 | ng_path_primal_cost = []
62 | cycles_in_path = []
63 | for p in range(len(new_path)):
64 | cyc = find_cycle(new_path[p][1:])
65 | cycles_in_path.append(cyc)
66 | if isNGRoute(cyc,g_node_dict):
67 | ng_path.append(new_path[p])
68 | ng_path_dual_cost.append(new_path_dual_cost[p])
69 | ng_path_primal_cost.append(new_path_primal_cost[p])
70 | if ng_path != []:
71 | return ng_path,ng_path_dual_cost,ng_path_primal_cost
72 | else:
73 | if completion_bound_flag == 1:
74 | T = generate_completion_bound(thenetwork,veh_cap, T_current)
75 | ng_iteration = ng_iteration + 1
76 | return
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/JingdongDataset_v2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/JingdongDataset_v2.zip
--------------------------------------------------------------------------------
/P-VRP/P-n16-k8.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n16-k8
2 | COMMENT : (Augerat et al, No of trucks: 8, Best value: 435)
3 | TYPE : CVRP
4 | DIMENSION : 16
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 35
7 | NODE_COORD_SECTION
8 | 1 30 40
9 | 2 37 52
10 | 3 49 49
11 | 4 52 64
12 | 5 31 62
13 | 6 52 33
14 | 7 42 41
15 | 8 52 41
16 | 9 57 58
17 | 10 62 42
18 | 11 42 57
19 | 12 27 68
20 | 13 43 67
21 | 14 58 48
22 | 15 58 27
23 | 16 37 69
24 | DEMAND_SECTION
25 | 1 0
26 | 2 19
27 | 3 30
28 | 4 16
29 | 5 23
30 | 6 11
31 | 7 31
32 | 8 15
33 | 9 28
34 | 10 8
35 | 11 8
36 | 12 7
37 | 13 14
38 | 14 6
39 | 15 19
40 | 16 11
41 | DEPOT_SECTION
42 | 1
43 | -1
44 | EOF
45 |
--------------------------------------------------------------------------------
/P-VRP/P-n19-k2.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n19-k2
2 | COMMENT : (Augerat et al, No of trucks: 2, Best value: 212)
3 | TYPE : CVRP
4 | DIMENSION : 19
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 160
7 | NODE_COORD_SECTION
8 | 1 30 40
9 | 2 37 52
10 | 3 49 43
11 | 4 52 64
12 | 5 31 62
13 | 6 52 33
14 | 7 42 41
15 | 8 52 41
16 | 9 57 58
17 | 10 62 42
18 | 11 42 57
19 | 12 27 68
20 | 13 43 67
21 | 14 58 27
22 | 15 37 69
23 | 16 61 33
24 | 17 62 63
25 | 18 63 69
26 | 19 45 35
27 | DEMAND_SECTION
28 | 1 0
29 | 2 19
30 | 3 30
31 | 4 16
32 | 5 23
33 | 6 11
34 | 7 31
35 | 8 15
36 | 9 28
37 | 10 14
38 | 11 8
39 | 12 7
40 | 13 14
41 | 14 19
42 | 15 11
43 | 16 26
44 | 17 17
45 | 18 6
46 | 19 15
47 | DEPOT_SECTION
48 | 1
49 | -1
50 | EOF
51 |
--------------------------------------------------------------------------------
/P-VRP/P-n20-k2.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n20-k2
2 | COMMENT : (Augerat et al, No of trucks: 2, Best value: 220)
3 | TYPE : CVRP
4 | DIMENSION : 20
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 160
7 | NODE_COORD_SECTION
8 | 1 30 40
9 | 2 37 52
10 | 3 49 49
11 | 4 52 64
12 | 5 31 62
13 | 6 52 33
14 | 7 42 41
15 | 8 52 41
16 | 9 57 58
17 | 10 62 42
18 | 11 42 57
19 | 12 27 68
20 | 13 43 67
21 | 14 58 48
22 | 15 58 27
23 | 16 37 69
24 | 17 61 33
25 | 18 62 63
26 | 19 63 69
27 | 20 45 35
28 | DEMAND_SECTION
29 | 1 0
30 | 2 19
31 | 3 30
32 | 4 16
33 | 5 23
34 | 6 11
35 | 7 31
36 | 8 15
37 | 9 28
38 | 10 8
39 | 11 8
40 | 12 7
41 | 13 14
42 | 14 6
43 | 15 19
44 | 16 11
45 | 17 26
46 | 18 17
47 | 19 6
48 | 20 15
49 | DEPOT_SECTION
50 | 1
51 | -1
52 | EOF
53 |
--------------------------------------------------------------------------------
/P-VRP/P-n21-k2.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n21-k2
2 | COMMENT : (Augerat et al, Min no of trucks: 2, Best value: 211)
3 | TYPE : CVRP
4 | DIMENSION : 21
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 160
7 | NODE_COORD_SECTION
8 | 1 30 40
9 | 2 37 52
10 | 3 49 49
11 | 4 52 64
12 | 5 31 62
13 | 6 52 33
14 | 7 42 41
15 | 8 52 41
16 | 9 57 58
17 | 10 62 42
18 | 11 42 57
19 | 12 27 68
20 | 13 43 67
21 | 14 58 48
22 | 15 58 27
23 | 16 37 69
24 | 17 38 46
25 | 18 61 33
26 | 19 62 63
27 | 20 63 69
28 | 21 45 35
29 | DEMAND_SECTION
30 | 1 0
31 | 2 7
32 | 3 30
33 | 4 16
34 | 5 23
35 | 6 11
36 | 7 19
37 | 8 15
38 | 9 28
39 | 10 8
40 | 11 8
41 | 12 7
42 | 13 14
43 | 14 6
44 | 15 19
45 | 16 11
46 | 17 12
47 | 18 26
48 | 19 17
49 | 20 6
50 | 21 15
51 | DEPOT_SECTION
52 | 1
53 | -1
54 | EOF
55 |
--------------------------------------------------------------------------------
/P-VRP/P-n22-k2.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n22-k2
2 | COMMENT : (Augerat et al, Min no of trucks: 2, Best value: 216)
3 | TYPE : CVRP
4 | DIMENSION : 22
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 160
7 | NODE_COORD_SECTION
8 | 1 30 40
9 | 2 37 52
10 | 3 49 49
11 | 4 52 64
12 | 5 31 62
13 | 6 52 33
14 | 7 42 41
15 | 8 52 41
16 | 9 57 58
17 | 10 62 42
18 | 11 42 57
19 | 12 27 68
20 | 13 43 67
21 | 14 58 48
22 | 15 58 27
23 | 16 37 69
24 | 17 38 46
25 | 18 61 33
26 | 19 62 63
27 | 20 63 69
28 | 21 45 35
29 | 22 56 37
30 | DEMAND_SECTION
31 | 1 0
32 | 2 7
33 | 3 30
34 | 4 16
35 | 5 23
36 | 6 11
37 | 7 19
38 | 8 15
39 | 9 28
40 | 10 8
41 | 11 8
42 | 12 7
43 | 13 14
44 | 14 6
45 | 15 19
46 | 16 11
47 | 17 12
48 | 18 26
49 | 19 17
50 | 20 6
51 | 21 15
52 | 22 10
53 | DEPOT_SECTION
54 | 1
55 | -1
56 | EOF
57 |
--------------------------------------------------------------------------------
/P-VRP/P-n22-k8.vrp:
--------------------------------------------------------------------------------
1 | NAME : P-n22-k8
2 | COMMENT : (Augerat et al, No of trucks: 8, Best value: 603)
3 | TYPE : CVRP
4 | DIMENSION : 22
5 | EDGE_WEIGHT_TYPE : EUC_2D
6 | CAPACITY : 3000
7 | NODE_COORD_SECTION
8 | 1 145 215
9 | 2 151 264
10 | 3 159 261
11 | 4 130 254
12 | 5 128 252
13 | 6 163 247
14 | 7 146 246
15 | 8 161 242
16 | 9 142 239
17 | 10 163 236
18 | 11 148 232
19 | 12 128 231
20 | 13 156 217
21 | 14 129 214
22 | 15 146 208
23 | 16 164 208
24 | 17 141 206
25 | 18 147 193
26 | 19 164 193
27 | 20 129 189
28 | 21 155 185
29 | 22 139 182
30 | DEMAND_SECTION
31 | 1 0
32 | 2 1100
33 | 3 700
34 | 4 800
35 | 5 1400
36 | 6 2100
37 | 7 400
38 | 8 800
39 | 9 100
40 | 10 500
41 | 11 600
42 | 12 1200
43 | 13 1300
44 | 14 1300
45 | 15 300
46 | 16 900
47 | 17 2100
48 | 18 1000
49 | 19 900
50 | 20 2500
51 | 21 1800
52 | 22 700
53 | DEPOT_SECTION
54 | 1
55 | -1
56 | EOF
57 |
--------------------------------------------------------------------------------
/SPPRC.py:
--------------------------------------------------------------------------------
1 | # coding=gb18030
2 | '''
3 | Author = Yao
4 | SPPRC
5 | '''
6 |
7 | import copy
8 | from read_input import *
9 | import time
10 | import cProfile
11 |
12 | class Label:
13 | def __init__(self):
14 | self.current_node_id = -1
15 | self.m_visit_sequence=[1]
16 | self.load = 0
17 | self.LabelCost = 0
18 | self.LabelCost2 = 0
19 | self.PrimalLabelCost = 0
20 | self.forbidden_set=[]
21 |
22 | def generate(self,from_label,to_node,g_link_dict,next_load,ADMM_flag):
23 | if ADMM_flag == 1:
24 | to_node_price = to_node.ADMM_price
25 | else:
26 | to_node_price = to_node.dual_price
27 | to_node_id = to_node.node_id
28 | the_link = g_link_dict[(from_label.current_node_id,to_node_id)]
29 | self.current_node_id = to_node_id
30 | self.m_visit_sequence = from_label.m_visit_sequence + [to_node_id]
31 | self.load = next_load
32 | self.LabelCost = from_label.LabelCost + the_link.distance - to_node_price - the_link.dual_price # the dual price of links is not always necessary
33 | self.LabelCost2 = from_label.LabelCost + the_link.distance - to_node_price
34 | self.PrimalLabelCost = from_label.PrimalLabelCost + the_link.distance
35 | ng_set = list(set(from_label.forbidden_set).intersection(set(to_node.ng_subset)))
36 | ng_set.append(to_node_id)
37 | self.forbidden_set = ng_set
38 |
39 | def generate_for_heuristic(self,from_label,to_node,g_link_dict,next_load):
40 | to_node_id = to_node.internal_id
41 | self.current_node_id = to_node_id
42 | self.m_visit_sequence = from_label.m_visit_sequence + [to_node_id]
43 | self.load = next_load
44 | self.LabelCost = from_label.LabelCost + link_no.distance - to_node.base_profit_for_searching - link_no.dual_price
45 | self.LabelCost2 = from_label.LabelCost + link_no.distance - to_node.base_profit_for_searching
46 | self.PrimalLabelCost = from_label.PrimalLabelCost + link_no.physical_dis
47 | self.forbidden_set = from_label.forbidden_set + [to_node_id]
48 |
49 | def _is_dominated(self,a, b):
50 | """returns whether a label {a} is dominated by another label {b}"""
51 | if a.LabelCost == b.LabelCost and a.forbidden_set==b.forbidden_set:
52 | label_dominated = False
53 | else:
54 | label_dominated = False
55 | if b.LabelCost <= a.LabelCost and set(b.forbidden_set)<= set(a.forbidden_set):
56 | label_dominated = True
57 | return label_dominated
58 |
59 | def is_not_dominated(self,label_bucket):
60 | if label_bucket==[]:
61 | return True
62 | else:
63 | for i in range(len(label_bucket)):
64 | if self._is_dominated(self, label_bucket[i]):
65 | return False
66 | return True
67 |
68 | def update_labelbucket_if_the_label_dominate_others_in(self,label_bucket):
69 | for i in range(len(label_bucket)):
70 | label_dominated = self._is_dominated(label_bucket[i], self)
71 | if label_dominated:
72 | label_bucket[i] = []
73 | while [] in label_bucket:
74 | label_bucket.remove([])
75 |
76 |
77 | def g_optimal_load_dependenet_dynamic_programming(thenetwork,veh_cap,g_node_dict,g_link_dict,T,completion_bound_flag,ADMM_flag,maintain_columns):
78 | origin_node = thenetwork.origin
79 | destination_node = thenetwork.destination
80 | T_current = [[float('inf') for i in range(len(thenetwork.nodes)+1)] for j in range(veh_cap + 1)]
81 | T_current[0][0] = 0
82 |
83 | label_set = [[ [] for i in range(len(thenetwork.nodes)+1)] for j in range(veh_cap + 1)]
84 | g_ending_state_vector = []
85 |
86 | original_label = Label()
87 | original_label.current_node_id = origin_node
88 | fixed_cost = 0
89 | original_label.LabelCost = -fixed_cost
90 | label_set[origin_node][0].append(original_label)
91 |
92 | for q in range(0, veh_cap + 1):
93 | for c in range(len(thenetwork.nodes)+1):
94 | for current_label in label_set[q][c]:
95 | from_node_id = current_label.current_node_id
96 | from_node = g_node_dict[from_node_id]
97 | for i in range(len(from_node.outbound_node_list)):
98 | to_node_id = from_node.outbound_node_list[i]
99 | if (from_node_id,to_node_id) in thenetwork.arcs:
100 | if to_node_id not in current_label.forbidden_set:
101 | to_node = g_node_dict[to_node_id]
102 | next_load = int(current_label.load + to_node.demand)
103 | if next_load <= veh_cap:
104 | new_label = Label()
105 | new_label.generate(current_label, to_node, g_link_dict,next_load,ADMM_flag)
106 | if to_node_id == destination_node:
107 | g_ending_state_vector.append(new_label)
108 | else:
109 | if ((new_label.LabelCost + T[veh_cap - next_load][to_node_id] < 0.0001) and (completion_bound_flag == 1))or (completion_bound_flag == 0):
110 | if new_label.is_not_dominated(label_set[next_load][to_node_id]):
111 | new_label.update_labelbucket_if_the_label_dominate_others_in(label_set[next_load][to_node_id])
112 | label_set[next_load][to_node_id].append(new_label)
113 | if T_current[next_load][to_node_id] > new_label.LabelCost:
114 | T_current[next_load][to_node_id] = new_label.LabelCost
115 | sorted_g_ending_state_vector = sorted(g_ending_state_vector, key=lambda x: x.LabelCost)
116 |
117 | temp_path_list = []
118 | temp_path_cost_list = []
119 | dual_price = [] #just for check
120 | if ADMM_flag == 1:
121 | return [sorted_g_ending_state_vector[0].m_visit_sequence],[sorted_g_ending_state_vector[0].LabelCost],[sorted_g_ending_state_vector[0].PrimalLabelCost],T_current
122 | else:
123 | for k in range(min(maintain_columns, len(sorted_g_ending_state_vector))):
124 | if sorted_g_ending_state_vector[k].LabelCost >= -0.0001:
125 | return temp_path_list, temp_path_cost_list, T_current
126 | # if g_ending_state_vector[k].m_visit_sequence[1] <= g_ending_state_vector[k].m_visit_sequence[-2]: #single direction
127 | else:
128 | temp_path_list.append(sorted_g_ending_state_vector[k].m_visit_sequence)
129 | temp_path_cost_list.append(sorted_g_ending_state_vector[k].PrimalLabelCost)
130 | dual_price.append(sorted_g_ending_state_vector[k].LabelCost)
131 | return temp_path_list, temp_path_cost_list , T_current
132 |
133 |
--------------------------------------------------------------------------------
/SolomonDataset_v2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/SolomonDataset_v2.zip
--------------------------------------------------------------------------------
/define_class.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/define_class.py
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | # coding=gb18030
2 | __author__ = 'Yao'
3 |
4 |
5 | import time
6 | import paraVRP
7 | from read_input import *
8 |
9 | from RMP import *
10 | from CG import *
11 | import Branch_and_Bound
12 | import cProfile
13 | import ADMM_based_framework
14 |
15 | time_limit = 900
16 | if __name__ == "__main__":
17 | print("Read input and Generate network...")
18 | instanceVRP = paraVRP.ParaVRP()
19 | instanceVRP.initParams()
20 | start_time = time.time()
21 | print("ADMM Starts")
22 | ADMMTree = ADMM_based_framework.ADMM(200)
23 | ADMMTree.conductADMM(instanceVRP)
24 | end_time = time.time()
25 | print("Total CPU time = ",end_time-start_time)
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/paraVRP.py:
--------------------------------------------------------------------------------
1 | # coding=gb18030
2 | import xlrd
3 | import numpy
4 | from read_input import *
5 | from datetime import datetime
6 |
7 | class ParaVRP:
8 | def __init__(self):
9 | self.input_file = ".\\P-VRP\\P-n16-k8.vrp"
10 | self.g_node_dict = {}
11 | self.g_link_dict = {}
12 | self.number_of_vehicles = 8
13 | self.rho = 1
14 | self.origin_node = -1
15 | self.destination_node = -1
16 |
17 | def initParams(self):
18 | self.g_node_dict, self.g_link_dict = g_ReadInputData(self)
19 |
20 | # with open(self.output_result_file, "w")as f:
21 | # now = datetime.now()
22 | # writer = csv.writer(f, delimiter=",", lineterminator='\n')
23 | # writer.writerow(['start time = {: %X}\n'.format(now)])
24 | # writer.writerow(["obj", "cols", "cuts", "x_solution", "y_solution", "time"])
25 | # with open(self.output_result_file2, "w")as f:
26 | # now = datetime.now()
27 | # writer = csv.writer(f, delimiter=",", lineterminator='\n')
28 | # writer.writerow(['start time = {: %X}\n'.format(now)])
29 | # writer.writerow(["Iteration", "ub", "lb", "Time"])
30 |
--------------------------------------------------------------------------------
/read_input.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YaoYuBJTU/ADMM_Python/719d251554bd33e874ff69e28ae4b11c78d86e03/read_input.py
--------------------------------------------------------------------------------