Skip to content

Commit

Permalink
release: 0.97.1
Browse files Browse the repository at this point in the history
- Improve image alt texts.
  • Loading branch information
basdirks-purple committed Oct 3, 2024
1 parent 99e3acd commit 2761c64
Show file tree
Hide file tree
Showing 38 changed files with 190 additions and 184 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
- Improve doctest and add image to `DistanceMatrix::periphery`.
- Improve doctest and add image to `PredecessorTree::search_by`.
- Improve doctest and add image to `PredecessorTree::search`.
- Improve image alt texts.
- Mention the order of traversal in the `Bfs` documentation.
- Mention the order of traversal in the `Dfs` documentation.
- Mention the order of traversal in the `Dijkstra` documentation.
- Standardize the input type for search algorithms.
- Test for `order > 0` in `bellman_ford_moore` and other algorithms that take a digraph.
- Replace the blanket implementations with macro implementations for the types in `repr`. In the documentation, describe examples of both the direct and the trait-based implementation of the traits.
- Replace the blanket implementations in `op` with custom implementations for the types in `repr`. In the documentation, describe examples of both the direct and the trait-based implementation of the traits.

## [0.97.1] - 2024-10-03

- Improve image alt texts.

## [0.97.0] - 2024-09-30

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "graaf"
version = "0.97.0"
version = "0.97.1"
edition = "2021"
authors = ["Bas Dirks <bas.dirks@protonmail.com>"]
categories = ["algorithms", "data-structures", "mathematics"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
graaf = "0.97.0"
graaf = "0.97.1"
```

## Representations
Expand Down
12 changes: 6 additions & 6 deletions src/algo/bellman_ford_moore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! The shortest path from vertex `0` to `4` is red. The dashed arcs represent
//! the other shortest distances.
//!
//! ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
//! ![A digraph and the shortest distances between the source vertex and the other vertices](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -47,7 +47,7 @@
//! There is no shortest path between vertices `0` and the other vertices due
//! to the negative cycle.
//!
//! ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
//! ![A digraph with a negative cycle](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -95,7 +95,7 @@ use crate::{
/// The shortest path from vertex `0` to `4` is red. The dashed arcs represent
/// the other shortest distances.
///
/// ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
/// ![A digraph and the shortest distances between the source vertex and the other vertices](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -129,7 +129,7 @@ use crate::{
/// There is no shortest path between vertices `0` and the other vertices due
/// to the negative cycle.
///
/// ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
/// ![A digraph with a negative cycle](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -191,7 +191,7 @@ impl<'a, D> BellmanFordMoore<'a, D> {
/// The shortest path from vertex `0` to `4` is red. The dashed arcs
/// represent the other shortest distances.
///
/// ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
/// ![A digraph and the shortest distances between the source vertex and the other vertices](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -225,7 +225,7 @@ impl<'a, D> BellmanFordMoore<'a, D> {
/// There is no shortest path between vertices `0` and the other vertices
/// due to the negative cycle.
///
/// ![Bellman-Ford-Moore](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
/// ![A digraph with a negative cycle](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bellman_ford_moore_2-0.87.4.svg)
///
/// ```
/// use graaf::{
Expand Down
8 changes: 4 additions & 4 deletions src/algo/bfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! The path from vertex `0` is red. `t` denotes the iteration indices.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_1-0.87.4.svg?)
//! ![A digraph and the breadth-first search from vertex `0`](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand All @@ -37,7 +37,7 @@
//!
//! The path from vertex `0` is red. The path from vertex `1` is blue.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_multi_source_1-0.87.4.svg?)
//! ![A digraph and a breadth-first traversal from two source vertices](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_multi_source_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -83,7 +83,7 @@ use {
///
/// The path from vertex `0` is red. `t` denotes the iteration indices.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_1-0.87.4.svg?)
/// ![A digraph and the breadth-first search from vertex `0`](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand All @@ -108,7 +108,7 @@ use {
///
/// The path from vertex `0` is red. The path from vertex `1` is blue.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_multi_source_1-0.87.4.svg?)
/// ![A digraph and a breadth-first traversal from two source vertices](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down
12 changes: 6 additions & 6 deletions src/algo/bfs_dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! The path from vertex `0` is red. `d` denotes the distances.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertex and the other vertices along the breadth-first tranversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -43,7 +43,7 @@
//!
//! The path from vertex `3` is red. The path from vertex `7` is blue.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_multi_source_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertices and the other vertices along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_multi_source_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -105,7 +105,7 @@ type Step = (usize, usize);
///
/// The path from vertex `0` is red. `d` denotes the distances.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertex and the other vertices along the breadth-first tranversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -136,7 +136,7 @@ type Step = (usize, usize);
///
/// The path from vertex `3` is red. The path from vertex `7` is blue.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_multi_source_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertices and the other vertices along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -219,7 +219,7 @@ impl<'a, D> BfsDist<'a, D> {
/// The path from vertex `0` is red. The dashed arcs represent the shortest
/// distances from the source. The gray arcs are not traversed.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_distances_1-0.91.3.svg?)
/// ![A digraph and the distances between the source vertex and the other vertices along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_distances_1-0.91.3.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<'a, D> BfsDist<'a, D> {
/// dashed arcs represent the shortest distances from the sources. The gray
/// arcs are not traversed.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_distances_multi_source_1-0.91.3.svg?)
/// ![A digraph and the distances between the source vertices and the other vertices along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_dist_distances_multi_source_1-0.91.3.svg?)
///
/// ```
/// use graaf::{
Expand Down
22 changes: 11 additions & 11 deletions src/algo/bfs_pred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! in the digraph, vertex `3` precedes `0`, but the BFS algorithm starts at
//! `0`.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_1-0.87.4.svg?)
//! ![A digraph and the predecessors along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -45,7 +45,7 @@
//!
//! The path from vertex `3` is red. The path from vertex `7` is blue.
//!
//! ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_multi_source_1-0.87.4.svg?)
//! ![A digraph and the predecessors along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_multi_source_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -110,7 +110,7 @@ type Step = (Option<usize>, usize);
/// in the digraph, vertex `3` precedes `0`, but the BFS algorithm starts at
/// `0`.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_1-0.87.4.svg?)
/// ![A digraph and the predecessors along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -141,7 +141,7 @@ type Step = (Option<usize>, usize);
///
/// The path from vertex `3` is red. The path from vertex `7` is blue.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_multi_source_1-0.87.4.svg?)
/// ![A digraph and the predecessors along the breadth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -224,7 +224,7 @@ impl<'a, D> BfsPred<'a, D> {
///
/// ## Single source, connected
///
/// ![Cycles with BFS, single source, connected](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_1-0.88.6.svg?)
/// ![Cycles along the breadth-first traversal in a connected digraph](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_1-0.88.6.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -261,7 +261,7 @@ impl<'a, D> BfsPred<'a, D> {
///
/// ## Single source, disconnected
///
/// ![Cycles with BFS, single source, disconnected](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_disconnected_1-0.88.6.svg?)
/// ![Cycles along the breadth-first traversal in a disconnect digraph](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_disconnected_1-0.88.6.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<'a, D> BfsPred<'a, D> {
///
/// ## Multiple sources, disconnected
///
/// ![Cycles with BFS, multiple sources, disconnected](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_multi_source_1-0.88.6.svg?)
/// ![Cycles along a multi-source breadth-first traversal along a disconnected digraph](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_cycles_multi_source_1-0.88.6.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -357,7 +357,7 @@ impl<'a, D> BfsPred<'a, D> {
/// The traversal from vertex `0` is red. The dashed arcs mark the
/// predecessor tree.
///
/// ![BFS and the predecessor tree](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_predecessors_1-0.87.4.svg?)
/// ![A digraph and the predecessor tree generated by a breadth-first search from a single source](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_predecessors_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -389,7 +389,7 @@ impl<'a, D> BfsPred<'a, D> {
/// The traversal from vertex `3` is red. The traversal from vertex `7`
/// is blue. The dashed arcs mark the predecessor trees.
///
/// ![BFS and the predecessor trees](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_predecessors_multi_source_1-0.87.4.svg?)
/// ![A digraph and the predecessor tree generated by a breadth-first search from multiple sources](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_predecessors_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -463,7 +463,7 @@ impl<'a, D> BfsPred<'a, D> {
///
/// The path from vertex `0` to the first vertex matching `v > 4` is red.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_shortest_path_1-0.87.4.svg?)
/// ![A digraph and the shortest path from vertex `0` to the first vertex matching `v > 4`](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_shortest_path_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -492,7 +492,7 @@ impl<'a, D> BfsPred<'a, D> {
/// The path from vertex `3` to the vertex matching `v == 2` is red. The
/// path from vertex `7` to the vertex matching `v == 5` is blue.
///
/// ![BFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_shortest_path_multi_source_1-0.87.4.svg?)
/// ![A digraph and two shortest paths.](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/bfs_pred_shortest_path_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down
8 changes: 4 additions & 4 deletions src/algo/dfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! The path from vertex `0` is red. `t` denotes the iteration indices.
//!
//! ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertex and the vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand All @@ -37,7 +37,7 @@
//!
//! The path from vertex `3` is red. The path from vertex `7` is blue.
//!
//! ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_multi_source_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertices and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_multi_source_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -75,7 +75,7 @@ use {
///
/// The path from vertex `0` is red. `t` denotes the iteration indices.
///
/// ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertex and the vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand All @@ -100,7 +100,7 @@ use {
///
/// The path from vertex `3` is red. The path from vertex `7` is blue.
///
/// ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_multi_source_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertices and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down
9 changes: 5 additions & 4 deletions src/algo/dfs_dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! The path from vertex `0` is red. `d` denotes the distances.
//!
//! ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertex and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -43,7 +43,7 @@
//!
//! The path from vertex `3` is red. The path from vertex `7` is blue.
//!
//! ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_multi_source_1-0.87.4.svg?)
//! ![A digraph and the distances between the source vertices and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_multi_source_1-0.87.4.svg?)
//!
//! ```
//! use graaf::{
Expand Down Expand Up @@ -91,7 +91,7 @@ type Step = (usize, usize);
///
/// The path from vertex `0` is red. `d` denotes the distances.
///
/// ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertex and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -122,7 +122,7 @@ type Step = (usize, usize);
///
/// The path from vertex `3` is red. The path from vertex `7` is blue.
///
/// ![DFS](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_multi_source_1-0.87.4.svg?)
/// ![A digraph and the distances between the source vertices and the other vertices along the depth-first traversal](https://raw.githubusercontent.com/bsdrks/graaf-images/main/out/dfs_dist_multi_source_1-0.87.4.svg?)
///
/// ```
/// use graaf::{
Expand Down Expand Up @@ -168,6 +168,7 @@ impl<'a, D> DfsDist<'a, D> {
///
/// * `digraph`: The digraph.
/// * `sources`: The source vertices.
#[must_use]
pub fn new<'b, T>(digraph: &'a D, sources: T) -> Self
where
T: IntoIterator<Item = &'b usize>,
Expand Down
Loading

0 comments on commit 2761c64

Please sign in to comment.