{"id":25781994,"url":"https://github.com/anshmnsoni/graphs","last_synced_at":"2025-07-19T10:07:52.594Z","repository":{"id":258242068,"uuid":"872494646","full_name":"AnshMNSoni/Graphs","owner":"AnshMNSoni","description":"All about Graph Theory (Discrete Mathematics) ","archived":false,"fork":false,"pushed_at":"2025-07-04T06:35:04.000Z","size":838,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T07:32:00.850Z","etag":null,"topics":["adjacency-matrix","collections","discrete-mathematics","math","matrix","object-oriented-programming","python","sympy","tabulate"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnshMNSoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-14T14:32:18.000Z","updated_at":"2025-07-04T06:35:07.000Z","dependencies_parsed_at":"2025-02-27T08:09:59.507Z","dependency_job_id":"e77a9500-3cfc-4ac7-b62a-356e90f9c814","html_url":"https://github.com/AnshMNSoni/Graphs","commit_stats":null,"previous_names":["anshmnsoni/adjacency-matrix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AnshMNSoni/Graphs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshMNSoni%2FGraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshMNSoni%2FGraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshMNSoni%2FGraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshMNSoni%2FGraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnshMNSoni","download_url":"https://codeload.github.com/AnshMNSoni/Graphs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnshMNSoni%2FGraphs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265915143,"owners_count":23848491,"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":["adjacency-matrix","collections","discrete-mathematics","math","matrix","object-oriented-programming","python","sympy","tabulate"],"created_at":"2025-02-27T07:35:12.603Z","updated_at":"2025-07-19T10:07:52.586Z","avatar_url":"https://github.com/AnshMNSoni.png","language":"Python","readme":"# About Graph Theory:\n\nThis repository contains a Python implementation of the famous **adjacency matrix** and **Graph Ploting** using the `Graph Theory` (Discrete Mathematics). The implementation includes generating an **adjacency matrix** for any given graph, which is represented by a set of vertices and edges.\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Graph Representation](#graph-representation)\n- [Usage](#usage)\n- [Dependencies](#dependencies)\n- [Example](#example)\n- [Output Format](#output-format)\n- [Contact](#contact)\n\n## Introduction\nAn Adjacency Matrix is a square matrix used to represent a graph, where:\n- Rows and columns represent vertices (nodes) of the graph.\n- Entries (elements) in the matrix indicate edge connections between vertices.\n\n## Graph Representation\n\nThe graph is represented using Python's `namedtuple` for defining the vertices and edges. Here's how the Konigsberg bridge problem is modeled:\n```python\nGraph = namedtuple('Graph', ['vertices', 'edges'])\n\nvertices = ['A', 'B', 'C', 'D']\nedges = [\n    (\"A\", \"B\"),\n    (\"A\", \"B\"),\n    (\"A\", \"C\"),\n    (\"A\", \"C\"),\n    (\"A\", \"D\"),\n    (\"B\", \"D\"),\n    (\"C\", \"D\")\n]\n\nG = Graph(vertices=vertices, edges=edges)\n```\n\n## Usage\n\n1) Clone the repository:\n```python\ngit clone https://github.com/yourusername/konigsberg-graph.git\n```\n\n2) Run the Python script to generate the adjacency matrix:\n```python\npython graph.py\n```\n\n## Dependencies\nLibraries: 1) collections 2) tabulate\n\nYou can install libraries via pip if needed:\n```python\npip install tabulate\n```\n```python\npip install collections\n```\n\n## Example\nHere's an example adjacency matrix for the Konigsberg graph:\n```\nvertices = ['A', 'B', 'C', 'D']\nedges = [\n    (\"A\", \"B\"),\n    (\"A\", \"B\"),\n    (\"A\", \"C\"),\n    (\"A\", \"C\"),\n    (\"A\", \"D\"),\n    (\"B\", \"D\"),\n    (\"C\", \"D\")\n]\n\nG = Graph(vertices=vertices, edges=edges)\nmatrix = adjacency_matrix(G)\n\n```\n\n## Output Format\n```\n╒═══╤═══╤═══╤═══╕\n│ 0 │ 2 │ 2 │ 1 │\n├───┼───┼───┼───┤\n│ 2 │ 0 │ 0 │ 1 │\n├───┼───┼───┼───┤\n│ 2 │ 0 │ 0 │ 1 │\n├───┼───┼───┼───┤\n│ 1 │ 1 │ 1 │ 0 │\n╘═══╧═══╧═══╧═══╛\n```\n\n## Preview:\n![image](https://github.com/user-attachments/assets/40de6778-24c1-47a5-a823-14c93cb77686)\n\n### 📢 Connect with Me\nIf you found this project helpful or have any suggestions, feel free to connect:\n\n- [![LinkedIn](https://img.shields.io/badge/LinkedIn-anshmnsoni-0077B5.svg?logo=linkedin)](https://www.linkedin.com/in/anshmnsoni)  \n- [![GitHub](https://img.shields.io/badge/GitHub-AnshMNSoni-181717.svg?logo=github)](https://github.com/AnshMNSoni)\n- [![Reddit](https://img.shields.io/badge/Reddit-u/AnshMNSoni-FF4500.svg?logo=reddit)](https://www.reddit.com/user/AnshMNSoni)\n\n### Thankyou 💫 \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanshmnsoni%2Fgraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanshmnsoni%2Fgraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanshmnsoni%2Fgraphs/lists"}