{"action":"created","comment":{"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments/56605395","id":56605395,"diff_hunk":"@@ -0,0 +1,47 @@\n+% Get same problem every time (fix random number generator start point)\r\n+rng('default')\r\n+\r\n+%% Generate a graph\r\n+n = 30; % Nodes\r\n+s = 100; % Space\r\n+% Random nodes\r\n+nodes = s*rand(n,2);\r\n+e = sparse(zeros(n,n));\r\n+D = sparse(zeros*ones(n,n));\r\n+\r\n+% Add closest p edges\r\n+p = 5;\r\n+for i = 1:n\r\n+    for j = 1:n\r\n+        d(j) = norm(nodes(i,:)-nodes(j,:));\r\n+    end\r\n+    [d2,ind] = sort(d);\r\n+    for j=1:p\r\n+        if (i~=ind(j))\r\n+            e(i,ind(j)) = 1;\r\n+            e(ind(j),i) = 1;\r\n+            D(i,ind(j)) = d(ind(j));\r\n+            D(ind(j),i) = d(ind(j));\r\n+        end\r\n+    end\r\n+end\r\n+\r\n+% Pick furthest apart start and end node\r\n+dmax = 0;\r\n+start = 0; finish = 0;\r\n+for i=1:n\r\n+    for j=i:n\r\n+        d = norm(nodes(i,:)-nodes(j,:));\r\n+        if (d>dmax)\r\n+            dmax = d;\r\n+            start =i;\r\n+            finish = j;\r\n+        end\r\n+    end\r\n+end\r\n+\r\n+\r","path":"matlab_simulation/08-planning/example_search_graph.m","position":43,"original_position":43,"commit_id":"3e0c0ab14ba7a0f6c28b5e383e3a6c725e724c4d","original_commit_id":"3e0c0ab14ba7a0f6c28b5e383e3a6c725e724c4d","user":{"login":"Rujie92","id":17360766,"avatar_url":"https://avatars.githubusercontent.com/u/17360766?v=3","gravatar_id":"","url":"https://api.github.com/users/Rujie92","html_url":"https://github.com/Rujie92","followers_url":"https://api.github.com/users/Rujie92/followers","following_url":"https://api.github.com/users/Rujie92/following{/other_user}","gists_url":"https://api.github.com/users/Rujie92/gists{/gist_id}","starred_url":"https://api.github.com/users/Rujie92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rujie92/subscriptions","organizations_url":"https://api.github.com/users/Rujie92/orgs","repos_url":"https://api.github.com/users/Rujie92/repos","events_url":"https://api.github.com/users/Rujie92/events{/privacy}","received_events_url":"https://api.github.com/users/Rujie92/received_events","type":"User","site_admin":false},"body":"Plottings of four methods might be displayed with separate figures instead of overlapping the previous one with the current one.","created_at":"2016-03-18T02:07:08Z","updated_at":"2016-03-18T02:07:08Z","html_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48#discussion_r56605395","pull_request_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments/56605395"},"html":{"href":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48#discussion_r56605395"},"pull_request":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48","id":61871827,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48","diff_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48.diff","patch_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48.patch","issue_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/48","number":48,"state":"open","locked":false,"title":"I21 graph search","user":{"login":"Chiasung","id":7796966,"avatar_url":"https://avatars.githubusercontent.com/u/7796966?v=3","gravatar_id":"","url":"https://api.github.com/users/Chiasung","html_url":"https://github.com/Chiasung","followers_url":"https://api.github.com/users/Chiasung/followers","following_url":"https://api.github.com/users/Chiasung/following{/other_user}","gists_url":"https://api.github.com/users/Chiasung/gists{/gist_id}","starred_url":"https://api.github.com/users/Chiasung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chiasung/subscriptions","organizations_url":"https://api.github.com/users/Chiasung/orgs","repos_url":"https://api.github.com/users/Chiasung/repos","events_url":"https://api.github.com/users/Chiasung/events{/privacy}","received_events_url":"https://api.github.com/users/Chiasung/received_events","type":"User","site_admin":false},"body":"- Merged four search algorithm into single function. All mixed together. Little messy. But we can easily to see the differences of them.\r\n\r\n- In the DFS algorithm, when we reach the descendant node which has been saved in the close set, we update that descendant node with the better cost. However, the cost won't be propagated to it's rest of descendants. That might be the reason to cause the back tracing fail somehow. \r\n- Added check end condition to BFS and DFS. This part was missing in the old code.\r\n\r\n- There is no linked list available for structure array. In order to reduce the memory usage, I attempted to create a function to do that. Not finished yet. It is under lib folder. Reference link [http://stackoverflow.com/questions/1413860/matlab-linked-list](url)","created_at":"2016-03-07T04:31:20Z","updated_at":"2016-03-18T02:07:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de883cfdc0e5aa1eddbda9e2747463483543fe00","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48/commits","review_comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48/comments","review_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/48/comments","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/3e0c0ab14ba7a0f6c28b5e383e3a6c725e724c4d","head":{"label":"WaterlooRobotics:i21-Graph_Search","ref":"i21-Graph_Search","sha":"3e0c0ab14ba7a0f6c28b5e383e3a6c725e724c4d","user":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":47763011,"name":"mobilerobotics","full_name":"WaterlooRobotics/mobilerobotics","owner":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics","description":"Matlab and Robot code for ME 597: Autonomous Mobile Robotics at the University of Waterloo","fork":false,"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics","forks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/forks","keys_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/teams","hooks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/hooks","issue_events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/events{/number}","events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/events","assignees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/assignees{/user}","branches_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/branches{/branch}","tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/tags","blobs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/refs{/sha}","trees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/{sha}","languages_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/languages","stargazers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/stargazers","contributors_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contributors","subscribers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscribers","subscription_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscription","commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/commits{/sha}","git_commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/commits{/sha}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/comments{/number}","issue_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/comments{/number}","contents_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contents/{+path}","compare_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/merges","archive_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/downloads","issues_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues{/number}","pulls_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls{/number}","milestones_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/milestones{/number}","notifications_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/labels{/name}","releases_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/releases{/id}","deployments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/deployments","created_at":"2015-12-10T13:19:41Z","updated_at":"2016-03-03T00:09:24Z","pushed_at":"2016-03-18T02:04:23Z","git_url":"git://github.com/WaterlooRobotics/mobilerobotics.git","ssh_url":"git@github.com:WaterlooRobotics/mobilerobotics.git","clone_url":"https://github.com/WaterlooRobotics/mobilerobotics.git","svn_url":"https://github.com/WaterlooRobotics/mobilerobotics","homepage":null,"size":1084,"stargazers_count":6,"watchers_count":6,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":46,"forks":6,"open_issues":46,"watchers":6,"default_branch":"master"}},"base":{"label":"WaterlooRobotics:master","ref":"master","sha":"b7dca812285a293b547f74957dafb98c1881b231","user":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":47763011,"name":"mobilerobotics","full_name":"WaterlooRobotics/mobilerobotics","owner":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics","description":"Matlab and Robot code for ME 597: Autonomous Mobile Robotics at the University of Waterloo","fork":false,"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics","forks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/forks","keys_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/teams","hooks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/hooks","issue_events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/events{/number}","events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/events","assignees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/assignees{/user}","branches_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/branches{/branch}","tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/tags","blobs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/refs{/sha}","trees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/{sha}","languages_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/languages","stargazers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/stargazers","contributors_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contributors","subscribers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscribers","subscription_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscription","commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/commits{/sha}","git_commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/commits{/sha}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/comments{/number}","issue_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/comments{/number}","contents_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contents/{+path}","compare_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/merges","archive_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/downloads","issues_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues{/number}","pulls_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls{/number}","milestones_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/milestones{/number}","notifications_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/labels{/name}","releases_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/releases{/id}","deployments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/deployments","created_at":"2015-12-10T13:19:41Z","updated_at":"2016-03-03T00:09:24Z","pushed_at":"2016-03-18T02:04:23Z","git_url":"git://github.com/WaterlooRobotics/mobilerobotics.git","ssh_url":"git@github.com:WaterlooRobotics/mobilerobotics.git","clone_url":"https://github.com/WaterlooRobotics/mobilerobotics.git","svn_url":"https://github.com/WaterlooRobotics/mobilerobotics","homepage":null,"size":1084,"stargazers_count":6,"watchers_count":6,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":46,"forks":6,"open_issues":46,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48"},"html":{"href":"https://github.com/WaterlooRobotics/mobilerobotics/pull/48"},"issue":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/48"},"comments":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/3e0c0ab14ba7a0f6c28b5e383e3a6c725e724c4d"}}}}