{"action":"closed","issue":{"url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/issues/12","repository_url":"https://api.github.com/repos/xavierliancw/Based-Itinerary","labels_url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/issues/12/comments","events_url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/issues/12/events","html_url":"https://github.com/xavierliancw/Based-Itinerary/issues/12","id":144406280,"number":12,"title":"As a baseball tourist, I would like the ability to have the program optimize the order of my itinerary for me so that my vacation requires the shortest possible distance.","user":{"login":"xavierliancw","id":10767668,"avatar_url":"https://avatars.githubusercontent.com/u/10767668?v=3","gravatar_id":"","url":"https://api.github.com/users/xavierliancw","html_url":"https://github.com/xavierliancw","followers_url":"https://api.github.com/users/xavierliancw/followers","following_url":"https://api.github.com/users/xavierliancw/following{/other_user}","gists_url":"https://api.github.com/users/xavierliancw/gists{/gist_id}","starred_url":"https://api.github.com/users/xavierliancw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavierliancw/subscriptions","organizations_url":"https://api.github.com/users/xavierliancw/orgs","repos_url":"https://api.github.com/users/xavierliancw/repos","events_url":"https://api.github.com/users/xavierliancw/events{/privacy}","received_events_url":"https://api.github.com/users/xavierliancw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/labels/mandatory%20requirement","name":"mandatory requirement","color":"fbca04"},{"url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/labels/story","name":"story","color":"eb6420"},{"url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/labels/under%20review","name":"under review","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":{"login":"xavierliancw","id":10767668,"avatar_url":"https://avatars.githubusercontent.com/u/10767668?v=3","gravatar_id":"","url":"https://api.github.com/users/xavierliancw","html_url":"https://github.com/xavierliancw","followers_url":"https://api.github.com/users/xavierliancw/followers","following_url":"https://api.github.com/users/xavierliancw/following{/other_user}","gists_url":"https://api.github.com/users/xavierliancw/gists{/gist_id}","starred_url":"https://api.github.com/users/xavierliancw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavierliancw/subscriptions","organizations_url":"https://api.github.com/users/xavierliancw/orgs","repos_url":"https://api.github.com/users/xavierliancw/repos","events_url":"https://api.github.com/users/xavierliancw/events{/privacy}","received_events_url":"https://api.github.com/users/xavierliancw/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/milestones/2","html_url":"https://github.com/xavierliancw/Based-Itinerary/milestones/Checkpoint%202","labels_url":"https://api.github.com/repos/xavierliancw/Based-Itinerary/milestones/2/labels","id":1661303,"number":2,"title":"Checkpoint 2","description":"- Code","creator":{"login":"xavierliancw","id":10767668,"avatar_url":"https://avatars.githubusercontent.com/u/10767668?v=3","gravatar_id":"","url":"https://api.github.com/users/xavierliancw","html_url":"https://github.com/xavierliancw","followers_url":"https://api.github.com/users/xavierliancw/followers","following_url":"https://api.github.com/users/xavierliancw/following{/other_user}","gists_url":"https://api.github.com/users/xavierliancw/gists{/gist_id}","starred_url":"https://api.github.com/users/xavierliancw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavierliancw/subscriptions","organizations_url":"https://api.github.com/users/xavierliancw/orgs","repos_url":"https://api.github.com/users/xavierliancw/repos","events_url":"https://api.github.com/users/xavierliancw/events{/privacy}","received_events_url":"https://api.github.com/users/xavierliancw/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":11,"state":"open","created_at":"2016-03-23T05:34:02Z","updated_at":"2016-04-25T23:04:02Z","due_on":"2016-05-02T07:00:00Z","closed_at":null},"comments":0,"created_at":"2016-03-29T22:21:26Z","updated_at":"2016-04-25T23:04:02Z","closed_at":"2016-04-25T23:04:02Z","body":"Overview:\n- There is a button on the itinerary page that says something like \"Optimize\"\n- Clicking this button will reorder the itinerary such that the vacation is optimized to travel the least distance\n- The first stadium queued in the itinerary stays at the top after optimization\n- The algorithm to calculate the least distance is Dijkstra's algorithm\n- Clicking the button when the itinerary has two or less stadiums will generate an error window\n- Requirement 1.1, 1.2, 3.1, 3.2\n\nTasks:\n- Requires a working itinerary that is implemented by an std::list\n- Requires a data structure that holds stadium distances\n- [x] Implement a class that implements Dijkstra's algorithm on the stadium graph\n- [x] Implement a function that looks at the std::list of the itinerary, and applies Dijkstra's algorithm to it such that it reorders the list to yield the shortest distance\n- [x] Make a button on the itinerary page that says something like \"Optimize\"\n- [x] Connect that button to the function\n- [x] Make a QMessageBox appear when the button is pressed when there are two or less stadiums in the itinerary that says something like, \"Can't optimize with this number of stadiums,\" or \"Itinerary is already optimized\"\n- [x] Desk check the algorithm on some test itineraries to check for algorithm implementation accuracy\n\nDefinition of Done:\n- [x] The Dijkstra's algorithm implementation is accurate\n- [x] There is a button that says something like \"Optimize\" on the itinerary builder page\n- [x] Clicking that button reorders the itinerary such that the trip requires the least possible distance to complete\n- [x] Clicking that button while there are two or less stadiums in the itinerary makes an error message pop up saying something like, \"This itinerary is already optimized\""}}