Skip to content

TSP #1

@edutco

Description

@edutco

TSP algorithm is a very complicated algorithm meant to answer the question-Given a list of nodes and the distances between each pair of nodes, what is the shortest possible route that visits each node? (it is possible to visit a node more than one time). The only way to solve this question is to check each route that visits all nodes and take the shortest one.
This kind of algorithm would take n! operations.
In our implementation of TSP, we preferred the algorithm to be fast and return a relatively short path over it to return the shortest one.
Our algorithm is a greedy algorithm that always goes to the nearest nodes from where we are now.
After visiting all the needed nodes it returns the path's length.
We try this way of solution every time with a different node and after n rounds we return the shortest path of all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions