ShabiiNetwork


NameShabiiNetwork JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/ShabiiPam/ShabiiNetwork
SummaryGraphs and Dijkstra's algorithm by Charawi Detphumi
upload_time2023-03-30 17:10:03
maintainer
docs_urlNone
authorCharawi Detphumi
requires_python
licenseMIT
keywords graph dijkstra charawi detphumi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ShabiiNetwork
=============

ShabiiNetwork is a Python library for dealing with Graphs and Dijkstra’s
algorithm.

Installation
------------

Use the package manager `pip <https://pip.pypa.io/en/stable/>`__ to
install ShabiiNetwork.

.. code:: bash

   pip install ShabiiNetwork

Usage
-----

.. code:: python

   from ShabiiNetwork import Digraph,Dijkstra

   graph2 = Digraph()

       #To check add_edge and add_edges functions
       graph2.add_edges([('A','B',0.3),('A','C',0.5),
                        ('B','A',0.3),('B','C',0.9),
                        ('C','A',0.5),('C','D',1.2),
                        ('D','C',1.2)])
       print(graph2.Edict)

       graph2.add_edges([('A','D',45),('A','E',23)])
       print(graph2.Edict)

       #To check remove_edge and remove_edges functions
       graph2.remove_edges([('A','D'),('A','E')])
       print(graph2.Edict)

       #To check add_vertex and add_vertices functions
       graph2.add_vertices(['I','J','K'])
       print(graph2.Edict)

       #To check remove_vertex and remove_vertices functions
       graph2.remove_vertices(['I','J','K'])
       print(graph2.Edict)

       #To check Dijkstra class and its functions
       dijkstra = Dijkstra(graph2, start_vertex='A')
       dijkstra.dijkstra()
       dijkstra.print_result()

       """
       Output:

       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}
       {'A': {'B': 0.3, 'C': 0.5, 'D': 45, 'E': 23}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}
       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}
       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}, 'I': {}, 'J': {}, 'K': {}}
       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}
       A -> A: ['A'] distance: 0
       A -> B: ['A', 'B'] distance: 0.3
       A -> C: ['A', 'C'] distance: 0.5
       A -> D: ['A', 'C', 'D'] distance: 1.7
       """

Contributing
------------

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author
------

Charawi Detphumi

License
-------

`MIT <https://choosealicense.com/licenses/mit/>`__

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ShabiiPam/ShabiiNetwork",
    "name": "ShabiiNetwork",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Graph,Dijkstra,Charawi,Detphumi",
    "author": "Charawi Detphumi",
    "author_email": "partgirlcharawi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/54/4e/a73d939eaf0032cdc0171108ad3f89853c474d5bb38091b31b9f83e6dae6/ShabiiNetwork-0.0.1.tar.gz",
    "platform": null,
    "description": "ShabiiNetwork\n=============\n\nShabiiNetwork is a Python library for dealing with Graphs and Dijkstra\u2019s\nalgorithm.\n\nInstallation\n------------\n\nUse the package manager `pip <https://pip.pypa.io/en/stable/>`__ to\ninstall ShabiiNetwork.\n\n.. code:: bash\n\n   pip install ShabiiNetwork\n\nUsage\n-----\n\n.. code:: python\n\n   from ShabiiNetwork import Digraph,Dijkstra\n\n   graph2 = Digraph()\n\n       #To check add_edge and add_edges functions\n       graph2.add_edges([('A','B',0.3),('A','C',0.5),\n                        ('B','A',0.3),('B','C',0.9),\n                        ('C','A',0.5),('C','D',1.2),\n                        ('D','C',1.2)])\n       print(graph2.Edict)\n\n       graph2.add_edges([('A','D',45),('A','E',23)])\n       print(graph2.Edict)\n\n       #To check remove_edge and remove_edges functions\n       graph2.remove_edges([('A','D'),('A','E')])\n       print(graph2.Edict)\n\n       #To check add_vertex and add_vertices functions\n       graph2.add_vertices(['I','J','K'])\n       print(graph2.Edict)\n\n       #To check remove_vertex and remove_vertices functions\n       graph2.remove_vertices(['I','J','K'])\n       print(graph2.Edict)\n\n       #To check Dijkstra class and its functions\n       dijkstra = Dijkstra(graph2, start_vertex='A')\n       dijkstra.dijkstra()\n       dijkstra.print_result()\n\n       \"\"\"\n       Output:\n\n       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}\n       {'A': {'B': 0.3, 'C': 0.5, 'D': 45, 'E': 23}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}\n       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}\n       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}, 'I': {}, 'J': {}, 'K': {}}\n       {'A': {'B': 0.3, 'C': 0.5}, 'B': {'A': 0.3, 'C': 0.9}, 'C': {'A': 0.5, 'D': 1.2}, 'D': {'C': 1.2}}\n       A -> A: ['A'] distance: 0\n       A -> B: ['A', 'B'] distance: 0.3\n       A -> C: ['A', 'C'] distance: 0.5\n       A -> D: ['A', 'C', 'D'] distance: 1.7\n       \"\"\"\n\nContributing\n------------\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\nAuthor\n------\n\nCharawi Detphumi\n\nLicense\n-------\n\n`MIT <https://choosealicense.com/licenses/mit/>`__\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Graphs and Dijkstra's algorithm by Charawi Detphumi",
    "version": "0.0.1",
    "split_keywords": [
        "graph",
        "dijkstra",
        "charawi",
        "detphumi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "544ea73d939eaf0032cdc0171108ad3f89853c474d5bb38091b31b9f83e6dae6",
                "md5": "04705b574d8ad454b1b15e87f29ce603",
                "sha256": "32879bdc5edd332f7f47d86cf07f9b63485f4441f3ba29ad2d84603ba35e1030"
            },
            "downloads": -1,
            "filename": "ShabiiNetwork-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "04705b574d8ad454b1b15e87f29ce603",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4278,
            "upload_time": "2023-03-30T17:10:03",
            "upload_time_iso_8601": "2023-03-30T17:10:03.528374Z",
            "url": "https://files.pythonhosted.org/packages/54/4e/a73d939eaf0032cdc0171108ad3f89853c474d5bb38091b31b9f83e6dae6/ShabiiNetwork-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-30 17:10:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ShabiiPam",
    "github_project": "ShabiiNetwork",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "shabiinetwork"
}
        
Elapsed time: 0.08718s