MATLAB Answers

# Traverse a directed graph visiting all edges at least once?

조회 수: 12(최근 30일)
Michael Bockwoldt 2021년 3월 24일
댓글: Christine Tobler 2021년 3월 25일
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?

댓글을 달려면 로그인하십시오.

### 답변(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표시숨기기 이전 댓글 수: 3
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!

Translated by