Not able to understand the CVRP data and cost !! #question
jignesh1010 opened this issue · 4 comments
HI There
i was trying to understand the dataset prep steps.
https://developers.google.com/optimization/routing/vrp
i couldnt understand the cost and distance matrix as compared to OR tool, if someone can help me understand overall matrix it would be helpful for me to solve my CVRP problem.
Thanks
In the link you provided, data['distance_matrix'][i][j]
returns the distance from i
to j
.
In the vrpy example, the matrix has the same structure, but there are two additional nodes, the Source and the Sink. All nodes can be reached from the Source, but no node points to the Source, and vice versa for the Sink.
how to form a data matrix which is showened as input , as the cost matrix is getting shifted compared to or tools e.g and addition of source and sync cost is confusing me slightly hence couldnt progress , if you can help understanding the input data fromat or how to prepare the matrix it would be to great help @Kuifje02
i am able to understand the OR tools data formation or can create that for my e.g but not able to understand same dataset here.
Here is an example with two nodes A and B. S denotes the source and T the sink. * denotes a random number.
S A B T
S 0 * * *
A 0 0 * *
B 0 * 0 *
T 0 0 0 0
The first column of zeros is because the Source has no predecessors. And the last line of zeros is because the Sink has no successors.
this query is resolved thanks for the update