Skip to content

Commit

Permalink
Merge branch 'main' into swap-nox-tox
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIsCoding authored Apr 18, 2023
2 parents 1b498d0 + 7ed0f1f commit c0e3d82
Show file tree
Hide file tree
Showing 9 changed files with 811 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ typed API based on the data type.
rustworkx.graph_complement
rustworkx.graph_union
rustworkx.graph_tensor_product
rustworkx.graph_token_swapper
rustworkx.graph_cartesian_product
rustworkx.graph_random_layout
rustworkx.graph_bipartite_layout
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/added-token-swapper-bd168eeb5a31bd99.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Added a new function, :func:`~.token_swapper()` which performs an
approximately optimal Token Swapping algorithm and supports partial
mappings (i.e. not-permutations) for graphs with missing tokens.
2 changes: 2 additions & 0 deletions rustworkx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ keywords = ["graph"]
ahash = "0.8.0"
fixedbitset = "0.4.2"
petgraph = "0.6.3"
rand = "0.8.5"
rand_pcg = "0.3.1"
rayon = "1.6"
num-traits = "0.2"
priority-queue = "1.2"
Expand Down
3 changes: 3 additions & 0 deletions rustworkx-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
//! * [`connectivity`](./connectivity/index.html)
//! * [`max_weight_matching`](./max_weight_matching/index.html)
//! * [`shortest_path`](./shortest_path/index.html)
//! * [`token_swapper`](./token_swapper/index.html)
//! * [`traversal`](./traversal/index.html)
//! * [`generators`](./generators/index.html)
//!
Expand Down Expand Up @@ -82,6 +83,8 @@ pub mod traversal;
pub mod dictmap;
pub mod distancemap;
mod min_scored;
/// Module for swapping tokens
pub mod token_swapper;
pub mod utils;

// re-export petgraph so there is a consistent version available to users and
Expand Down
Loading

0 comments on commit c0e3d82

Please sign in to comment.