Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compute maximum bisimulation using Paige-Tarjan's Algorithm #1089

Merged
merged 32 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d05589a
fighting a lot with the borrowchecker and dont want to wrap in cells
sander-hergarten Feb 12, 2024
1ab1908
rewrote initialization
sander-hergarten Feb 12, 2024
7bd3845
adjusted build_counterimage to work with new blocks
sander-hergarten Feb 12, 2024
b1345e8
Rewrote group_by_counterimage and split. Added new CounterImageGroup
sander-hergarten Feb 12, 2024
896e9f5
removed repartition and instead expanded the split function
sander-hergarten Feb 12, 2024
ffd0d93
Merge branch 'Qiskit:main' into bisimulation-1
sander-hergarten Feb 12, 2024
91bec28
fixed various bugs
sander-hergarten Feb 15, 2024
23c9d81
added return iterator
sander-hergarten Feb 15, 2024
933523f
added tests
sander-hergarten Feb 15, 2024
52068cf
Merge branch 'Qiskit:main' into bisimulation-1
sander-hergarten Feb 15, 2024
75dbc97
Merge branch 'bisimulation-1' of https://github.com/sander-hergarten/…
sander-hergarten Feb 15, 2024
5b52281
typing stubs
sander-hergarten Feb 15, 2024
ee04e58
added docs and fixed styling
sander-hergarten Feb 15, 2024
e0ce060
added release notes
sander-hergarten Feb 15, 2024
f6188bd
removed unnecessary categories from release notes
sander-hergarten Feb 16, 2024
bf513f6
use Entry enum instead of .contains_key to fill Hash Map
sander-hergarten Feb 18, 2024
40631a7
adjusted test to use self.subTest
sander-hergarten Feb 18, 2024
cc9a81c
improved error handling
sander-hergarten Feb 18, 2024
f0947cd
removed unused enum
sander-hergarten Feb 19, 2024
8f02d8e
Added test for multigraph compatibility
sander-hergarten Feb 26, 2024
e3e6990
fixed multigraph compatability
sander-hergarten Feb 26, 2024
439fa91
added comment
sander-hergarten Feb 26, 2024
d4ce046
added new custom return type IndexPartitionBlock
sander-hergarten Feb 26, 2024
7231cd9
adjusted release notes and fixed formatting
sander-hergarten Mar 3, 2024
40761f4
added typing stubs for IndexPartitionBlock
sander-hergarten Mar 3, 2024
7dbe776
included IndexPartitionBlock in lib.rs
sander-hergarten Mar 3, 2024
cd242d1
Merge branch 'Qiskit:main' into bisimulation-1
sander-hergarten Apr 30, 2024
0af1736
changed types to work with new custom_vec_iter_impl! macro
sander-hergarten Apr 30, 2024
90396db
Merge branch 'main' into bisimulation-1
sander-hergarten May 10, 2024
ad49260
fixed broken stubs
sander-hergarten May 24, 2024
891757d
Merge branch 'main' into bisimulation-1
sander-hergarten Jun 21, 2024
d40c7cf
Merge branch 'main' into bisimulation-1
IvanIsCoding Jun 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions releasenotes/notes/maximum-bisimulation-942a9d0dc9b46ee4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
features:
- |
Added a new function :func:`~rustworkx.digraph_maximum_bisimulation` to
compute the maximum bisimulation or relational coarsest partition of a
graph. This function is based on the algorithm described in the publication
"Three partition refinement algorithms" by Paige and Tarjan. This function
recieves a graph and returns a
:class:`~rustworkx.RelationalCoarsestPartition`. This function is in regards
to issue `#1075 <https://github.com/Qiskit/rustworkx/issues/1075>`__.
- |
Added a new class :class:`~rustworkx.RelationalCoarsestPartition` to output
the maximum bisimulation or relational coarsest partition of a graph. This
class contains instances of :class:`~rustworkx.IndexPartitionBlock` and can be
iterated over.
- |
Added a new class :class:`~rustworkx.IndexPartitionBlock` to output
a block of a node partition. This class is an iterator over node indices.
3 changes: 3 additions & 0 deletions rustworkx/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ from .rustworkx import InvalidMapping as InvalidMapping
from .rustworkx import GraphNotBipartite as GraphNotBipartite
from .rustworkx import ColoringStrategy as ColoringStrategy

from .rustworkx import digraph_maximum_bisimulation as digraph_maximum_bisimulation
from .rustworkx import digraph_cartesian_product as digraph_cartesian_product
from .rustworkx import graph_cartesian_product as graph_cartesian_product
from .rustworkx import digraph_eigenvector_centrality as digraph_eigenvector_centrality
Expand Down Expand Up @@ -246,6 +247,8 @@ from .rustworkx import BFSPredecessors as BFSPredecessors
from .rustworkx import EdgeIndexMap as EdgeIndexMap
from .rustworkx import EdgeIndices as EdgeIndices
from .rustworkx import Chains as Chains
from .rustworkx import IndexPartitionBlock as IndexPartitionBlock
from .rustworkx import RelationalCoarsestPartition as RelationalCoarsestPartition
from .rustworkx import EdgeList as EdgeList
from .rustworkx import NodeMap as NodeMap
from .rustworkx import NodesCountMapping as NodesCountMapping
Expand Down
10 changes: 10 additions & 0 deletions rustworkx/rustworkx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ def is_maximal_matching(
/,
) -> bool: ...

# Maximum Bisimulation

def digraph_maximum_bisimulation(graph: PyDiGraph) -> RelationalCoarsestPartition: ...

# Planar

def is_planar(graph: PyGraph, /) -> bool: ...
Expand Down Expand Up @@ -1091,6 +1095,12 @@ class EdgeIndices(_RustworkxCustomVecIter[int]): ...
@final
class Chains(_RustworkxCustomVecIter[EdgeIndices]): ...

@final
class IndexPartitionBlock(_RustworkxCustomVecIter[int]): ...

@final
class RelationalCoarsestPartition(_RustworkxCustomVecIter[IndexPartitionBlock]): ...

@final
class EdgeList(_RustworkxCustomVecIter[tuple[int, int]]): ...

Expand Down
Loading