예제 #1
0
 def find_all_paths(self, start, end, upper_bound, k_max = K_MAX):
     return compute_k_shortest_threshold(k_max,
                                         upper_bound,
                                         start,
                                         end,
                                         self.node_ids,
                                         self.node_lons,
                                         self.node_lats,
                                         self.neigh_origins,
                                         self.neigh_dests,
                                         self.edge_weights)
예제 #2
0
edges = np.asanyarray([edge_0_1, edge_0_3, 
                       edge_1_0, edge_1_2, edge_1_3,
                       edge_2_1, edge_2_3,
                       edge_3_0, edge_3_2, edge_3_4,
                       edge_4_3],
                      dtype = np.double)

node_ids       =  nodes[:,0]
node_lons      =  nodes[:,1]
node_lats      =  nodes[:,2]

neigh_origins  =  edges[:,0]
neigh_dests    =  edges[:,1]
edge_weights   =  edges[:,2]

k_max = 10
threshold = 10.0
source_id = 0
sink_id = 4

print compute_k_shortest_threshold(k_max,
                             threshold,
                             source_id,
                             sink_id,
                             node_ids,
                             node_lons,
                             node_lats,
                             neigh_origins,
                             neigh_dests,
                             edge_weights)
예제 #3
0
 def find_all_paths(self, start, end, upper_bound, k_max=K_MAX):
     return compute_k_shortest_threshold(k_max, upper_bound, start, end,
                                         self.node_ids, self.node_lons,
                                         self.node_lats, self.neigh_origins,
                                         self.neigh_dests,
                                         self.edge_weights)