Traverse a directed graph visiting all edges at least once?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am working on a project utilizing the Chinese Postman Problem where I want to find the shortest path in a directed matrix that visits each edge at least once starting from a specified node. Are there any Graph Theory functions that deal with this kind of problem?
0 comentarios
Respuestas (1)
Christine Tobler
el 24 de Mzo. de 2021
There aren't any functions for MATLAB's graph object that solve this problem. Possibly you can formulate this as an optimization problem? See https://www.mathworks.com/help/optim/ug/traveling-salesman-problem-based.html for an example of how to solve the related Traveling Salesman Problem using the optimization toolbox.
4 comentarios
Christine Tobler
el 25 de Mzo. de 2021
This could be used to solve the Traveling Salesman problem (not efficiently), but not for the variant your looking for.
Here I'm just going through all possible ways of visiting each node exactly once, and then taking the minimum of that large set of possibilities. But when nodes can be visited many times, there's no way to just write up all possible orders of visiting the nodes, there are infinitely many ways to do this.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!