You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**BisPy** is a Python package for the computation of the maximum bisimulation of directed graphs. At the moment it supports the following algorithms:
8
+
9
+
**BisPy** is a Python package for the computation of the maximum bisimulation
10
+
of directed graphs. At the moment it supports the following algorithms:
11
+
6
12
- Paige-Tarjan
7
13
- Dovier-Piazza-Policriti
8
14
- Saha
9
15
10
-
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).
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.
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.
63
+
64
+
The interface to _Saha_'s algorithm is a little bit different since we
65
+
do not want to rebuild the **BisPy** representation of the graph from scratch
66
+
everytime we add a new edge. We are going to consider the same `graph` object
67
+
which we created in the example above:
68
+
69
+
```python
70
+
>>>from bispy import decorate_nx_graph, to_tuple_list, paige_tarjan_qblocks, saha
71
+
```
72
+
73
+
We build the **BisPy** representation of the graph, once and forever:
74
+
75
+
```python
76
+
>>> vertexes, qblocks = decorate_nx_graph(graph)
77
+
```
78
+
79
+
We now need to compute the maximum bisimulation of the graph, since as you can
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.
94
+
We can now use _Saha_'s algorithm to update the maximum bisimulation
95
+
incrementally. We assumed to have some method `random_edges_generator` to
96
+
generate new edges to be added to the graph:
57
97
58
-
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.
To build the HTML version of the docs locally use:
99
151
@@ -106,88 +158,86 @@ The generated html can be found in `docs/build/html`.
106
158
107
159
## Testing
108
160
109
-
We are using **GitHub actions** for continuous intergration testing. To run tests locally (`pytest` is required) use the following command from the root folder of **BisPy**:
161
+
We are using **GitHub actions** for continuous intergration testing. To run
162
+
tests locally (`pytest` is required) use the following command from the root
163
+
folder of **BisPy**:
110
164
111
165
```bash
112
166
> pytest tests
113
167
```
114
168
115
169
## Authors and acknowledgements
116
-
**BisPy** is currently developed and mantained by **Francesco Andreuzzi**.
117
-
You can contact me at:
118
-
* andreuzzi.francesco at gmail.com
119
-
* fandreuz at sissa.it
120
170
121
-
The project has been developed under the supervision of professor
122
-
**Alberto Casagrande** (*University of Trieste*), which was my advisor for
123
-
my *bachelor thesis*.
171
+
**BisPy** is currently developed and mantained by **Francesco Andreuzzi**. You
172
+
can contact me at:
173
+
174
+
- andreuzzi.francesco at gmail.com
175
+
- fandreuz at sissa.it
176
+
177
+
The project has been developed under the supervision of professor **Alberto
178
+
Casagrande** (_University of Trieste_), which was my advisor for my _bachelor
179
+
thesis_.
124
180
125
181
## How to contribute
182
+
126
183
Contributors are welcome! We are more than happy to receive contributions on
127
184
tests, documentation and new features. Our
128
185
[Issues](https://github.com/fAndreuzzi/BisPy/issues) section is always full of
129
186
things to do.
130
187
131
188
Here are the guidelines to submit a patch:
132
189
133
-
1. Start by opening a new [issue](https://github.com/fAndreuzzi/BisPy/issues)
134
-
describing the bug you want to fix, or the feature you want to
135
-
introduce. This lets us keep track of what is being done at the moment,
136
-
and possibly avoid writing different solutions for the same problem.
190
+
1. Start by opening a new [issue](https://github.com/fAndreuzzi/BisPy/issues)
191
+
describing the bug you want to fix, or the feature you want to introduce.
192
+
This lets us keep track of what is being done at the moment, and possibly
193
+
avoid writing different solutions for the same problem.
137
194
138
-
2. Fork the project, and setup a **new** branch to work in (*fix-issue-22*,
139
-
for instance). If you do not separate your work in different branches
140
-
you may have a bad time when trying to push a pull request to fix
141
-
a particular issue.
195
+
2. Fork the project, and setup a **new** branch to work in (_fix-issue-22_, for
196
+
instance). If you do not separate your work in different branches you may
197
+
have a bad time when trying to push a pull request to fix a particular
198
+
issue.
142
199
143
-
3. Run the [**black**](https://github.com/psf/black) formatter before pushing
144
-
your code for review.
200
+
3. Run the [**black**](https://github.com/psf/black) formatter before pushing
201
+
your code for review.
145
202
146
-
4. Any significant changes should almost always be accompanied by tests. The
147
-
project already has good test coverage, so look at some of the existing
148
-
tests if you're unsure how to go about it.
203
+
4. Any significant changes should almost always be accompanied by tests. The
204
+
project already has good test coverage, so look at some of the existing
205
+
tests if you're unsure how to go about it.
149
206
150
-
5. Provide menaningful **commit messages** to help us keeping a good *git*
151
-
history.
207
+
5. Provide menaningful **commit messages** to help us keeping a good _git_
208
+
history.
152
209
153
-
6. Finally you can submbit your *pull request*!
210
+
6. Finally you can submbit your _pull request_!
154
211
155
212
## References
213
+
156
214
During the development we constulted the following resources:
0 commit comments