简体   繁体   中英

Shortest path for undirected weighted graph without source and target vertices

My teacher gave us a list of countries and asked us to find the shortest path(visits all the nodes exactly once) in the shortest time possible. I've created a matrix whose vertices are countries and edges are flights between them (weights are the amount of time for each flight). But I have no idea how to do this exercise.

It sounds like travelling salesman problem . You can search it for yourself, there are several solutions on the web for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM