{"id":24598509,"url":"https://github.com/kikoveiga/feup-da2","last_synced_at":"2025-03-28T21:14:47.952Z","repository":{"id":158471648,"uuid":"633924563","full_name":"kikoveiga/feup-da2","owner":"kikoveiga","description":"Algorithm Design (DA) Second Project (2022/2023): BSc in Informatics and Computing Engineering @ FEUP","archived":false,"fork":false,"pushed_at":"2023-06-07T19:27:44.000Z","size":12799,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T07:46:00.703Z","etag":null,"topics":["cpp","feup","feup-da","feup-leic","tsp","tsp-solver"],"latest_commit_sha":null,"homepage":"https://sigarra.up.pt/feup/en/ucurr_geral.ficha_uc_view?pv_ocorrencia_id=501678","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kikoveiga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-28T15:40:36.000Z","updated_at":"2024-12-13T02:09:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa02eb11-4ae7-4fee-ba6f-85a1b1e0d554","html_url":"https://github.com/kikoveiga/feup-da2","commit_stats":null,"previous_names":["kikoveiga/da2"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikoveiga%2Ffeup-da2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikoveiga%2Ffeup-da2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikoveiga%2Ffeup-da2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikoveiga%2Ffeup-da2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kikoveiga","download_url":"https://codeload.github.com/kikoveiga/feup-da2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246100580,"owners_count":20723479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","feup","feup-da","feup-leic","tsp","tsp-solver"],"created_at":"2025-01-24T12:16:52.904Z","updated_at":"2025-03-28T21:14:47.923Z","avatar_url":"https://github.com/kikoveiga.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project 2 - Travelling Salesman Problem\n\n\u003ch3\u003eProject made by:\u003c/h3\u003e\n\u003ch6\u003ePedro Vidal Marcelino\t- up202108754@up.pt\u003c/h6\u003e\n\u003ch6\u003eJose Francisco Reis Pedreiras Neves Veiga\t\t- up202108753@up.pt\u003c/h6\u003e\n\u003ch6\u003eAntonio Marujo Rama\t  - up202108801@up.pt\u003c/h6\u003e\n\nThis project was done for the Design of Algorithms curricular unit @ **FEUP - Faculdade de Engenharia da Universidade do Porto**.\nIt implements different algorithms and heuristics for solving the Traveling Salesman Problem (TSP) using C++ and provides a menu-based interface to interact with the algorithms and compare their performance on various graphs.\n\n\u003ch2\u003eAlgorithms Implemented\u003c/h2\u003e\n  \n  **TSP Backtracking** - It gives the optimal solution, efficient for small graphs.\n  \n  **Kruskal and Prim** - Algorithms designed to find the Minimum Spanning Tree (MST) of the graph that help in other algorithms such as **Christofides** and Greedy Heuristics.\n  \n  **TSP 2 Approximation Heuristic** - Relies on the triangular inequality, guarantees a ratio of at most 2 times the optimal solution.\n  \n  **TSP Nearest Neighbor Heuristic** - Greedy heuristic which always chooses the next cheapest node to visit, similar to Prim's algorithm.\n  \n  **TSP Greedy Heuristic** - Another greedy heuristic which always chooses the cheapest edge, similar to Kruskal's algorithm. Implemented with a priority queue and used in complete graphs.\n  \n  **TSP 1 Tree Lower Bound** - Algorithm that calculates the largest MST with Prim after removing each node. Finds the best lower bound for the optimal solution.\n  \n  **Christofides Algorithm** - Maybe the best algorithm for finding an approximation for the optimal solution in an efficient way in complete graphs. Guarantees a ratio of at most 1.5 times the optimal solution.\n  \n  **TSP 2 Opt Improvement** - Algorithm that takes a TSP path as input and, using local search, keeps swapping pairs of nodes until it doesn't find a better path. Improves many of the above algorithms' solutions.\n  \n  **Other Functions** - Other functions implemented to parse the information given on the csv files, the **Haversine** function for finding the distance between two geographical locations, and other algorithms.\n  \n  \u003ch2\u003eResults\u003c/h2\u003e\n  \n  ![image.png](dataset/image.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikoveiga%2Ffeup-da2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikoveiga%2Ffeup-da2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikoveiga%2Ffeup-da2/lists"}