semvec/pypi-packages huggingface dataset:
Pyraph 0.1.0
DO!
License: MIT
Requires Python: >=3.9
Keywords: pyraph,graph,tree

.. image:: https://img.shields.io/pypi/pyversions/Pyraph
    :target: https://pypi.org/project/Pyraph/

.. image:: https://img.shields.io/pypi/v/Pyraph
    :target: https://pypi.org/project/Pyraph/

.. image:: https://readthedocs.org/projects/pyraph/badge/?version=latest
    :target: https://pyraph.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/github/license/Aspect1103/Pyraph
    :target: LICENSE

.. image:: https://img.shields.io/lgtm/grade/python/g/Aspect1103/Pyraph.svg?logo=lgtm&logoWidth=18
    :target: https://lgtm.com/projects/g/Aspect1103/Pyraph/context:python

Pyraph
======

A simple and easy to use python library for simulating networks and graphs.

Installation
------------
Pyraph requires Python 3.9 or higher, however, earlier versions may work. You can download the latest version of python `here <https://www.python.org/downloads/>`_.

To install Pyraph, use one of the commands below:

.. code:: sh

    # Windows
    py -3.9 -m pip install -U pyraph

    # Linux/macOS
    python3.9 -m pip install -U pyraph

Usage
-----
A simple and easy example to initialise a graph with a couple vertexs and some edges then run a couple algorithms on it.

.. code:: py

    # Import libraries
    import pyraph
    import pyraph.algorithms

    # Create graph
    graph = pyraph.Graph()

    # Add vertexs
    graph.add_vertex("A")
    graph.add_vertex("B")
    graph.add_vertex("C")

    # Add edges
    graph.add_edge("A", "B", 2)
    graph.add_edge("B", "C", 3)
    graph.add_edge("C", "A", 1)
    graph.add_edge("B", "A", 5)

    # Run vertex traversal algorithms
    print(pyraph.algorithms.dfs(graph, "B"))

    print(pyraph.algorithms.bfs(graph, "A"))

    print(pyraph.algorithms.dijkstra(graph, "C", "A"))

    # Save the graph to a file
    graph.to_image(DO!)

Links
-----
- `Official Documentation <https://pyraph.readthedocs.io/en/latest/>`_
- `Source Code <https://github.com/Aspect1103/Pyraph>`_
- `Issue Tracker <https://github.com/Aspect1103/Pyraph/issues>`_