|
1 | 1 | import setuptools |
2 | 2 |
|
3 | | -with open("README.md", "r", encoding="utf-8") as fh: |
4 | | - long_description = fh.read() |
| 3 | +long_description = """ |
| 4 | + <a href='https://coveralls.io/github/fAndreuzzi/BisPy'><img src='https://coveralls.io/repos/github/fAndreuzzi/BisPy/badge.svg' alt='Coverage Status' /></a> |
| 5 | + [](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE) <img src='https://img.shields.io/badge/Code%20style-Black-%23000000'/> [](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/?badge=latest) |
| 6 | +
|
| 7 | +## Description |
| 8 | +**BisPy** is a Python package for the computation of the maximum bisimulation of directed graphs. At the moment it supports the following algorithms: |
| 9 | +- Paige-Tarjan |
| 10 | +- Dovier-Piazza-Policriti |
| 11 | +- Saha |
| 12 | +
|
| 13 | +An brief introduction to the problem can be found [here](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/?badge=latest#a-brief-introduction-to-bisimulation). |
| 14 | +
|
| 15 | +## Usage |
| 16 | +### Paige-Tarjan, Dovier-Piazza-Policriti |
| 17 | +Compute the maximum bisimulation of a graph (represented by an object of type `networkx.DiGraph`): |
| 18 | +```python |
| 19 | +> import networkx as nx |
| 20 | +> from bispy import paige_tarjan, dovier_piazza_policriti |
| 21 | +
|
| 22 | +# we create the graph |
| 23 | +> graph = networkx.balanced_tree(2,3) |
| 24 | +
|
| 25 | +# Paige-Tarjan's algorithm |
| 26 | +> paige_tarjan(graph) |
| 27 | +[(7, 8, 9, 10, 11, 12, 13, 14), (3, 4, 5, 6), (1, 2), (0,)] |
| 28 | +
|
| 29 | +# and Dovier-Piazza-Policriti's algorithm |
| 30 | +> dovier_piazza_policriti(graph) |
| 31 | +[(7, 8, 9, 10, 11, 12, 13, 14), (3, 4, 5, 6), (1, 2), (0,)] |
| 32 | +``` |
| 33 | +
|
| 34 | +More about the available features (like using a *labeling set*) is discussed in the documentation for [Paige-Tarjan](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/algorithms/paige_tarjan.html)'s and [Dovier-Piazza-Policriti](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/algorithms/dovier_piazza_policriti.html)'s algorithms. |
| 35 | +
|
| 36 | +### Saha |
| 37 | +The interface for using *Saha*'s algorithm is a little bit different since we do not want to rebuild the *BisPy* representation of the graph from scratch. |
| 38 | +```python |
| 39 | +> import networkx as nx |
| 40 | +> from bispy import decorate_nx_graph, to_tuple_list, paige_tarjan_qblocks, saha |
| 41 | +
|
| 42 | +# we create the graph |
| 43 | +> graph = networkx.balanced_tree(2,3) |
| 44 | +
|
| 45 | +# we build its BisPy representation |
| 46 | +> vertexes, qblocks = decorate_nx_graph(graph) |
| 47 | +# compute the maximum bisimulation. `maximum_bisimulation is a list of `_QBlock` objects |
| 48 | +> maximum_bisimulation = paige_tarjan_qblocks(qblocks) |
| 49 | +
|
| 50 | +# from now on we can update the maximum bisimulation incrementally, everytime |
| 51 | +# we add a new edge to the graph |
| 52 | +> new_edges_list = random_edges_generator() |
| 53 | +> for edge in new_edges_list: |
| 54 | +> maximum_bisimulation = saha(maximum_bisimulation, vertexes, edge) |
| 55 | +> # print the current maximum bisimulation |
| 56 | +> print(to_tuple_list(maximum_bisimulation)) |
| 57 | +``` |
| 58 | +
|
| 59 | +Note that *Saha*'s algorithm must be applied on a **maximum bisimulation**, otherwise it is going to return wrong results. This is why we called `paige_tarjan_qblocks` (which is just a version of *Paige-Tarjan*'s algorithm which can be applied to the variable `qblocks`) before the call to *Saha*'s algorithm. |
| 60 | +
|
| 61 | +You can read more about [Saha](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/algorithms/saha.html#)'s algorithm and the module [graph_decorator](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/utilities/graph_decorator.html) on the documentation. |
| 62 | +
|
| 63 | +## Dependencies and installation |
| 64 | +**BisPy** requires requires the modules `llist, networkx`. The code is tested |
| 65 | +for *Python 3*, while compatibility with *Python 2* is not guaranteed. It can |
| 66 | +be installed using `pip` or directly from the source code. |
| 67 | +
|
| 68 | +## Documentation |
| 69 | +We used [Sphinx](http://www.sphinx-doc.org/en/stable/) and |
| 70 | +[ReadTheDocs](https://readthedocs.org/) for code documentation. You can view |
| 71 | +the documentation [here](https://bispy-bisimulation-in-python.readthedocs.io/en/latest/?badge=latest). |
| 72 | +
|
| 73 | +## Authors and acknowledgements |
| 74 | +**BisPy** is currently developed and mantained by **Francesco Andreuzzi**. |
| 75 | +You can contact me at: |
| 76 | +* andreuzzi.francesco at gmail.com |
| 77 | +* fandreuz at sissa.it |
| 78 | +
|
| 79 | +## License |
| 80 | +See the [LICENSE](LICENSE) file for license rights and limitations (MIT). |
| 81 | +""" |
5 | 82 |
|
6 | 83 | setuptools.setup( |
7 | 84 | name="BisPy", |
8 | | - version="0.1.1", |
| 85 | + version="0.1.2", |
9 | 86 |
|
10 | 87 | author="Francesco Andreuzzi", |
11 | 88 | author_email="andreuzzi.francesco@gmail.com", |
|
0 commit comments