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 19 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
14 changes: 14 additions & 0 deletions releasenotes/notes/maximum-bisimulation-942a9d0dc9b46ee4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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.NodeIndices` and can be
iterated over.
2 changes: 2 additions & 0 deletions rustworkx/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ from .rustworkx import FailedToConverge as FailedToConverge
from .rustworkx import InvalidMapping as InvalidMapping
from .rustworkx import GraphNotBipartite as GraphNotBipartite

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 @@ -237,6 +238,7 @@ 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 RelationalCoarsestPartition as RelationalCoarsestPartition
from .rustworkx import EdgeList as EdgeList
from .rustworkx import NodeMap as NodeMap
from .rustworkx import NodesCountMapping as NodesCountMapping
Expand Down
7 changes: 7 additions & 0 deletions rustworkx/rustworkx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,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 @@ -1025,6 +1029,9 @@ class EdgeIndices(_RustworkxCustomVecIter[int]): ...
@final
class Chains(_RustworkxCustomVecIter[EdgeIndices]): ...

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

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

Expand Down
Loading
Loading