Source and Sink terms
orlandombaa opened this issue · 4 comments
Hello every one
I have a doubt about the terms used in the library. In the examples when you generate the distance matrix you start with the rows which correspond "from source" that I assumed means the depot. The last rows of the matrix have values of 0 and it corresponds to "From Sink".
What does the sink mean in this case and why it has a value of 0?
Thank you!
Hi !
The depot is modeled by two differents nodes, the Source and Sink, which have the same location. The Source is the depot from which vehicles start their route, while the Sink is depot where the vehicles end their route. So there cannot be any incoming edges into the Source, and no outgoing edges from the Sink, hence the zeros in the distance matrix.
Does this clarify things ?
Hello @Kuifje02 thank you for the answer. Yes, it clarifies the situation with the Source and Sink.
However, one more doubt emerges from this. So, the optimal solution that the model generates takes into consideration the return cost of the vehicles to the depot?. Because if the Sink is the Depot too but It has values of 0 in the distance matrix, the cost from returning the vehicles to the depot is 0 too isn't ?
So, the optimal solution that the model generates takes into consideration the return cost of the vehicles to the depot?
yes, this cost is taken into account, on the edges TO the Sink.
Because if the Sink is the Depot too but It has values of 0 in the distance matrix, the cost from returning the vehicles to the depot is 0 too isn't ?
The 0s in the distance matrix are on the edges LEAVING the Sink (and not entering), as these edges cannot exist.
Thank you @Kuifje02 !