Skip to content

Commit ff37b26

Browse files
committed
update readme
1 parent c22243d commit ff37b26

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ package _NetworkX_, which we use to represent graphs:
3434

3535
```python
3636
>>> import networkx as nx
37-
>>> from bispy import paige_tarjan, dovier_piazza_policriti
37+
>>> from bispy import compute_maximum_bisimulation, Algorithms
3838
```
3939

4040
We then create a simple graph:
@@ -45,49 +45,50 @@ We then create a simple graph:
4545

4646
It's important to set `create_using=nx.DiGraph` since **BisPy** works only with
4747
_directed_ graphs. Now we can compute the _maximum bisimulation_ using
48-
_Paige-Tarjan_'s algorithm:
48+
_Paige-Tarjan_'s algorithm, which is the default for the function
49+
`compute_maximum_bisimulation`:
4950

5051
```python
51-
>>> paige_tarjan(graph)
52+
>>> compute_maximum_bisimulation(graph)
5253
[(7, 8, 9, 10, 11, 12, 13, 14), (3, 4, 5, 6), (1, 2), (0,)]
5354
```
5455

55-
as well as _Dovier-Piazza-Policriti_'s algorithm.
56+
We can use _Dovier-Piazza-Policriti_'s algorithm as well:
5657

5758
```python
58-
>>> dovier_piazza_policriti(graph)
59+
>>> compute_maximum_bisimulation(graph, algorithm=Algorithms.DovierPiazzaPolicriti)
5960
[(7, 8, 9, 10, 11, 12, 13, 14), (3, 4, 5, 6), (1, 2), (0,)]
6061

6162
```
6263

6364
We may also introduce a _labeling set_ (or _initial partition_):
6465

6566
```python
66-
>>> dovier_piazza_policriti(graph, initial_partition=[(0,7,10), (1,2,3,4,5,6,8,9,11,12,13,14)])
67+
>>> compute_maximum_bisimulation(graph, initial_partition=[(0,7,10), (1,2,3,4,5,6,8,9,11,12,13,14)])
6768
[(7, 10), (8, 9, 11, 12, 13, 14), (3, 4, 5, 6), (1, 2), (0,)]
6869

6970
```
7071

7172
### Saha
7273

73-
In order to use *Saha*'s algorithm we only need to import the following
74+
In order to use _Saha_'s algorithm we only need to import the following
7475
function:
7576

7677
```python
7778
>>> from bispy import saha
7879
```
7980

80-
We call that function to obtain an object of type `SahaPartition`, which has
81-
a method called `add_edge`. This method adds a new edge to the graph and
81+
We call that function to obtain an object of type `SahaPartition`, which has a
82+
method called `add_edge`. This method adds a new edge to the graph and
8283
recomputes the maximum bisimulation incrementally:
8384

8485
```python
8586
saha_partition = saha(graph)
8687
```
8788

88-
(We reused the `graph` object which we defined in the previous paragraph).
89-
We can now use the aforementioned method `add_edge` (note that when you call
90-
this method the instance of `graph` which you passed is **not** modified):
89+
(We reused the `graph` object which we defined in the previous paragraph). We
90+
can now use the aforementioned method `add_edge` (note that when you call this
91+
method the instance of `graph` which you passed is **not** modified):
9192

9293
```python
9394
>>> for edge in [(1,0), (4,0)]:

0 commit comments

Comments
 (0)