{"id":23165056,"url":"https://github.com/zain-bin-arshad/social-network-simulator","last_synced_at":"2026-04-01T23:41:04.625Z","repository":{"id":173445698,"uuid":"268122252","full_name":"Zain-Bin-Arshad/Social-Network-Simulator","owner":"Zain-Bin-Arshad","description":"Social Network Simulator developed in python.","archived":false,"fork":false,"pushed_at":"2020-05-31T09:27:47.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-28T13:32:14.731Z","etag":null,"topics":["data-structures","linked-list","network-simulator","node","python","python3","social-network-graph","social-network-like-facebook"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Zain-Bin-Arshad.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,"zenodo":null}},"created_at":"2020-05-30T16:54:07.000Z","updated_at":"2024-12-11T08:55:28.000Z","dependencies_parsed_at":"2024-01-26T18:30:57.246Z","dependency_job_id":null,"html_url":"https://github.com/Zain-Bin-Arshad/Social-Network-Simulator","commit_stats":null,"previous_names":["zain-bin-arshad/social-network-simulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Zain-Bin-Arshad/Social-Network-Simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zain-Bin-Arshad%2FSocial-Network-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zain-Bin-Arshad%2FSocial-Network-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zain-Bin-Arshad%2FSocial-Network-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zain-Bin-Arshad%2FSocial-Network-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zain-Bin-Arshad","download_url":"https://codeload.github.com/Zain-Bin-Arshad/Social-Network-Simulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zain-Bin-Arshad%2FSocial-Network-Simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31013964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T02:58:54.984Z","status":"ssl_error","status_checked_at":"2026-03-27T02:58:46.993Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-structures","linked-list","network-simulator","node","python","python3","social-network-graph","social-network-like-facebook"],"created_at":"2024-12-18T01:14:51.553Z","updated_at":"2026-03-27T03:15:29.381Z","avatar_url":"https://github.com/Zain-Bin-Arshad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social-Network-Simulator\n\nA man once said:\n\n\u003e If you want to learn a new language start with simple syntax ans then implement Data Structures in that language\n\nWell, that's what I was doing when I dived into python. I started implementing `list, linked list, graph` etc. I wanted to develop a project that will use all these concepts, so that I can develop better understanding of these concepts.  Ever thought how Facebook, Linked-in, Instagram worked? Well, I have and that's what I wanted to develop.\n\nThis project simulates a \"Social Network\", where you can:\n\n- Make friends\n- Follow and un-follow people\n- Create, like and delete posts\n\n## How to run?\nYou have to run \"SocialSim.py\". No additional packages are required, this project only uses features that are present standard python distribution.\n\n![usage](https://user-images.githubusercontent.com/49767636/83347690-18f27a00-a340-11ea-9cde-17562ccc4129.jpg)\n\nAs you can see there are two modesin which you can use this program, details are as follow:\n\n### Interactive mode\nIn this mode, user can interact with the program and will have to provide input at each step as he/she wants, this is how a interactive mode looks like:\n\n![intr](https://user-images.githubusercontent.com/49767636/83347742-89010000-a340-11ea-8fb8-d8914e087ee3.jpg)\n\n#### Load Network\nUsing this function you can create a network, there are further two more options:\n\n![load](https://user-images.githubusercontent.com/49767636/83347764-bcdc2580-a340-11ea-87f9-183e6325994f.jpg)\n\n#### Load new network\nIf you want to load a new network from a network file you should use this option. Sample run of loading from text file:\n\n![load new network](https://user-images.githubusercontent.com/49767636/83347859-54da0f00-a341-11ea-9d69-3d369d50ea95.jpg)\n\n\nAs you can see the network is loaded when we print the network it prints as expected. Remember **Format of the network input should be exactly same as the network.txt file that is provided**.\n\n#### Load saved network\nIf you have created a network and made some changes, saved the network using **Save network**. You can load the graph from the saved pickle file.\n\n![saved](https://user-images.githubusercontent.com/49767636/83347962-36284800-a342-11ea-9536-22d9101e53b0.jpg)\n\n#### Set Probabilities\nIt is probability in percentage(%), that how much likely a person will follow another person, or much likely a person will like the post. If you think this application as a \"Disease spread simulation\", this parameter will mean that how much is likely for a healthy person get affected by the disease. \n\n![pro](https://user-images.githubusercontent.com/49767636/83348049-c1094280-a342-11ea-8aae-32c5f222d335.jpg)\n\n#### Node Operations\nAs the graph is a linked-list of a linked-lists, so, A node is representing a person in the network. If you want to:\n\n**Sign-up in the network**\n\n![insert](https://user-images.githubusercontent.com/49767636/83348191-a6839900-a343-11ea-9400-038b3fba6532.jpg)\n\n\n**Get removed from the network**\n![delete](https://user-images.githubusercontent.com/49767636/83348171-750acd80-a343-11ea-852d-cc99cbc94ac6.jpg)\n\n**Find a friend in network**\n\n![found](https://user-images.githubusercontent.com/49767636/83348147-412fa800-a343-11ea-8fca-285d8d00d257.jpg)\n\n#### Edge Operations\nEdge represent a connection between various persons in the network. If you want to:\n\n**Add a friend**\nWe will make \"Rex\" a friend of \"Imran khan\".\n![add](https://user-images.githubusercontent.com/49767636/83348313-d54e3f00-a344-11ea-8313-df63dd6df573.jpg)\n\n**Remove a friend**\nWe will remove \"Rex\" as a friend of \"Imran khan\".\n![remov](https://user-images.githubusercontent.com/49767636/83348335-fd3da280-a344-11ea-8553-85be0237e8ad.jpg)\n\n### New Post\nIts just like making a new post and publishing it. Now, how many will like this post and how many will follow the person in return, depends on the **Probabilities** we set earlier (remember ???)\n![post](https://user-images.githubusercontent.com/49767636/83348411-c4ea9400-a345-11ea-8f58-62c8f3b2e5e4.jpg)\n\n#### Display Network\nShould I tell what this option will do ?\n![display](https://user-images.githubusercontent.com/49767636/83348435-fbc0aa00-a345-11ea-91fb-53e00394babb.jpg)\n\n#### Display Statistics\nThis option will display various stats like:\n\n- Number of posts made by a person\n- Post ordered by their popularity\n- Number of likes, friends, friends of etc\n\n![stata](https://user-images.githubusercontent.com/49767636/83348452-3a566480-a346-11ea-825d-ad2a5e129635.jpg)\n\n#### Update\nAs we are in simulation mode, we have to update the network manually. What does this **update** means? You have created a post, now people will start liking the post as you update the network. In other terms, it is a mean of progressing through time.\n![update](https://user-images.githubusercontent.com/49767636/83348540-0f204500-a347-11ea-8a9a-f559d7cdc66b.jpg)\n\n#### Save Network\nYou have made changes to your network and wants to save the network for future use, don't worry I got you covered. Use this option to save the network as a pickle file.\n![optn 9](https://user-images.githubusercontent.com/49767636/83348571-7211dc00-a347-11ea-9966-9d55feee5d07.jpg)\n\n#### Exit \nDone spending hours and hours on my network and now wants to go to sleep ? Use this option to exit.\n\n### Simulation mode\nYou don't have time to manually create posts, follow, unfollow people and want to automate things. Use **events.txt** to save all the events and run a simulation on them.\nEvents file can have events of adding a friend, removing a friend, posting, liking etc. See the  events.txt for more information. Remember **Your events file should be in same format as the given events.txt**\n\nOnce you have run the simulation a **Simulation_Log.txt** file will appear that will contains various stats and other logs\n![sim](https://user-images.githubusercontent.com/49767636/83348752-b2be2500-a348-11ea-9c71-5b0a64b94f14.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzain-bin-arshad%2Fsocial-network-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzain-bin-arshad%2Fsocial-network-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzain-bin-arshad%2Fsocial-network-simulator/lists"}