Traverse a directed graph visiting all edges at least once?
16 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Christine Tobler
2021-3-24
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 个评论
Christine Tobler
2021-3-25
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!