{"action":"closed","number":6,"pull_request":{"url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6","id":55410328,"html_url":"https://github.com/stefanp227/PandaSocialNetwork/pull/6","diff_url":"https://github.com/stefanp227/PandaSocialNetwork/pull/6.diff","patch_url":"https://github.com/stefanp227/PandaSocialNetwork/pull/6.patch","issue_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/6","number":6,"state":"closed","locked":false,"title":"my idea for graph structure of relationships","user":{"login":"JustBePlayer","id":15856247,"avatar_url":"https://avatars.githubusercontent.com/u/15856247?v=3","gravatar_id":"","url":"https://api.github.com/users/JustBePlayer","html_url":"https://github.com/JustBePlayer","followers_url":"https://api.github.com/users/JustBePlayer/followers","following_url":"https://api.github.com/users/JustBePlayer/following{/other_user}","gists_url":"https://api.github.com/users/JustBePlayer/gists{/gist_id}","starred_url":"https://api.github.com/users/JustBePlayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustBePlayer/subscriptions","organizations_url":"https://api.github.com/users/JustBePlayer/orgs","repos_url":"https://api.github.com/users/JustBePlayer/repos","events_url":"https://api.github.com/users/JustBePlayer/events{/privacy}","received_events_url":"https://api.github.com/users/JustBePlayer/received_events","type":"User","site_admin":false},"body":"Няма нужда да мърджваш промените. Използвам Pull Request, за да ти покажа моят файл \"Panda_aleydin.rb\", чрез който представям моята идея за графичното представяне на потребителите (Панди) в нашата малка социална мрежа. Значи има 2 начина да представим нашият граф: като Adjacency Matrix или Adjacency Lists. \r\nhttp://www.sitepoint.com/graph-algorithms-ruby/\r\n\r\nТук са описани 2-та подхода и предимството им, като е наблегнато на матрицата, като по-лесният вяриант да се случат нещата. Обаче на мен по-прегледно някак ми изглеждат нещата за реализация чрез хеш и списъци, както е вторият варянт. Така съм го направил и аз във файла, който commit-нах в моя бранч (може да го разгледаш). Добавил съм няколко функции(сприятеляване, лист от приятели и дали 2 панди са приятели), които са на базиса на това дефиниране на графа. Трудната част тук е намирането на ниво на съседство, т.е обхождането му в ниво по-голямо от 1-во. В интернет има повече примери за това как става с матрици, но за нашият подход (adjacency lists, почти нищо няма, поне за езика Ruby). Намерих това обхождане:\r\nhttp://agstem.org/post/70487438025/oh-the-places-youll-go-depth-first-search\r\nсамо, че трябва да се модифицира и някак да преброяваме нивата на влизане.\r\n\r\nАко прецениш, може да структурираме графа и чрез матрици, но матрицата винаги трябва да е квадратна и при добавяне на нова панда в мрежата и впоследствие нов ред в матрицата, трябва да разширяваме и всеки ред с нова колона накрая, за да може да стане квадратна, което мисля, че си е излишна работа. ","created_at":"2016-01-08T00:24:52Z","updated_at":"2016-01-10T23:03:02Z","closed_at":"2016-01-10T23:03:02Z","merged_at":"2016-01-10T23:03:02Z","merge_commit_sha":"5fe9bb67ffceeb21fdc64f3346874560381a515c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6/commits","review_comments_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6/comments","review_comment_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/6/comments","statuses_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/statuses/93c262292ac46b78308da44261424ea3bd98db18","head":{"label":"stefanp227:slave_aleydin","ref":"slave_aleydin","sha":"93c262292ac46b78308da44261424ea3bd98db18","user":{"login":"stefanp227","id":2463560,"avatar_url":"https://avatars.githubusercontent.com/u/2463560?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanp227","html_url":"https://github.com/stefanp227","followers_url":"https://api.github.com/users/stefanp227/followers","following_url":"https://api.github.com/users/stefanp227/following{/other_user}","gists_url":"https://api.github.com/users/stefanp227/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanp227/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanp227/subscriptions","organizations_url":"https://api.github.com/users/stefanp227/orgs","repos_url":"https://api.github.com/users/stefanp227/repos","events_url":"https://api.github.com/users/stefanp227/events{/privacy}","received_events_url":"https://api.github.com/users/stefanp227/received_events","type":"User","site_admin":false},"repo":{"id":49220915,"name":"PandaSocialNetwork","full_name":"stefanp227/PandaSocialNetwork","owner":{"login":"stefanp227","id":2463560,"avatar_url":"https://avatars.githubusercontent.com/u/2463560?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanp227","html_url":"https://github.com/stefanp227","followers_url":"https://api.github.com/users/stefanp227/followers","following_url":"https://api.github.com/users/stefanp227/following{/other_user}","gists_url":"https://api.github.com/users/stefanp227/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanp227/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanp227/subscriptions","organizations_url":"https://api.github.com/users/stefanp227/orgs","repos_url":"https://api.github.com/users/stefanp227/repos","events_url":"https://api.github.com/users/stefanp227/events{/privacy}","received_events_url":"https://api.github.com/users/stefanp227/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanp227/PandaSocialNetwork","description":"","fork":false,"url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork","forks_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/forks","keys_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/teams","hooks_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/hooks","issue_events_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/events{/number}","events_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/events","assignees_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/assignees{/user}","branches_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/branches{/branch}","tags_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/tags","blobs_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/languages","stargazers_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/stargazers","contributors_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/contributors","subscribers_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/subscribers","subscription_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/subscription","commits_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/contents/{+path}","compare_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/merges","archive_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/downloads","issues_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues{/number}","pulls_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/labels{/name}","releases_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/releases{/id}","created_at":"2016-01-07T17:57:10Z","updated_at":"2016-01-07T18:20:40Z","pushed_at":"2016-01-10T23:03:03Z","git_url":"git://github.com/stefanp227/PandaSocialNetwork.git","ssh_url":"git@github.com:stefanp227/PandaSocialNetwork.git","clone_url":"https://github.com/stefanp227/PandaSocialNetwork.git","svn_url":"https://github.com/stefanp227/PandaSocialNetwork","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stefanp227:master","ref":"master","sha":"df432de71d9e31938ebd2efe809d864afb29ff87","user":{"login":"stefanp227","id":2463560,"avatar_url":"https://avatars.githubusercontent.com/u/2463560?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanp227","html_url":"https://github.com/stefanp227","followers_url":"https://api.github.com/users/stefanp227/followers","following_url":"https://api.github.com/users/stefanp227/following{/other_user}","gists_url":"https://api.github.com/users/stefanp227/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanp227/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanp227/subscriptions","organizations_url":"https://api.github.com/users/stefanp227/orgs","repos_url":"https://api.github.com/users/stefanp227/repos","events_url":"https://api.github.com/users/stefanp227/events{/privacy}","received_events_url":"https://api.github.com/users/stefanp227/received_events","type":"User","site_admin":false},"repo":{"id":49220915,"name":"PandaSocialNetwork","full_name":"stefanp227/PandaSocialNetwork","owner":{"login":"stefanp227","id":2463560,"avatar_url":"https://avatars.githubusercontent.com/u/2463560?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanp227","html_url":"https://github.com/stefanp227","followers_url":"https://api.github.com/users/stefanp227/followers","following_url":"https://api.github.com/users/stefanp227/following{/other_user}","gists_url":"https://api.github.com/users/stefanp227/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanp227/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanp227/subscriptions","organizations_url":"https://api.github.com/users/stefanp227/orgs","repos_url":"https://api.github.com/users/stefanp227/repos","events_url":"https://api.github.com/users/stefanp227/events{/privacy}","received_events_url":"https://api.github.com/users/stefanp227/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanp227/PandaSocialNetwork","description":"","fork":false,"url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork","forks_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/forks","keys_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/teams","hooks_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/hooks","issue_events_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/events{/number}","events_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/events","assignees_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/assignees{/user}","branches_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/branches{/branch}","tags_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/tags","blobs_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/languages","stargazers_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/stargazers","contributors_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/contributors","subscribers_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/subscribers","subscription_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/subscription","commits_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/contents/{+path}","compare_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/merges","archive_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/downloads","issues_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues{/number}","pulls_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/labels{/name}","releases_url":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/releases{/id}","created_at":"2016-01-07T17:57:10Z","updated_at":"2016-01-07T18:20:40Z","pushed_at":"2016-01-10T23:03:03Z","git_url":"git://github.com/stefanp227/PandaSocialNetwork.git","ssh_url":"git@github.com:stefanp227/PandaSocialNetwork.git","clone_url":"https://github.com/stefanp227/PandaSocialNetwork.git","svn_url":"https://github.com/stefanp227/PandaSocialNetwork","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6"},"html":{"href":"https://github.com/stefanp227/PandaSocialNetwork/pull/6"},"issue":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/6"},"comments":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/stefanp227/PandaSocialNetwork/statuses/93c262292ac46b78308da44261424ea3bd98db18"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"JustBePlayer","id":15856247,"avatar_url":"https://avatars.githubusercontent.com/u/15856247?v=3","gravatar_id":"","url":"https://api.github.com/users/JustBePlayer","html_url":"https://github.com/JustBePlayer","followers_url":"https://api.github.com/users/JustBePlayer/followers","following_url":"https://api.github.com/users/JustBePlayer/following{/other_user}","gists_url":"https://api.github.com/users/JustBePlayer/gists{/gist_id}","starred_url":"https://api.github.com/users/JustBePlayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustBePlayer/subscriptions","organizations_url":"https://api.github.com/users/JustBePlayer/orgs","repos_url":"https://api.github.com/users/JustBePlayer/repos","events_url":"https://api.github.com/users/JustBePlayer/events{/privacy}","received_events_url":"https://api.github.com/users/JustBePlayer/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":4,"additions":396,"deletions":3,"changed_files":4}}