1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-FileCopyrightText: 2025 Slatian 2025
//
// SPDX-License-Identifier: LGPL-3.0-only
//! ## Where to start
//!
//! Construct a [Graph], run one of the `populate_*()` methods and follow its recommendations on a `run_*()` method.
//!
//! Example: TextRank keyword extraction
//! ```rust
//! use unobtanium_graph_algorithms::Graph;
//!
//! let mut graph = Graph::new();
//! graph.populate_for_textrank(&["This", "text", "is", "about", "cats", "and", "dogs", "but", "mostly", "dogs"], 2);
//! let result = graph.run_pagerank(&Default::default());
//!
//! // The top word is "dogs"
//! let top_word = result.sorted_iter().next().unwrap();
//! assert_eq!(*top_word.0, "dogs");
//! assert!(top_word.1 > 1.3, "Expected: score (={0}) > 1.3", top_word.1);
//!
//! // The total value in the pagerank graph is equal to the result length
//! let total_score_sum = result.unsorted_iter().fold(0.0, |a, i| a+i.1);
//! assert_eq!(result.len() as f32, total_score_sum);
//! ```
pub use BrandedNodeId;
pub use Graph;
pub use MutableGraph;
pub use RankedNodes;
pub use SortedRankedNodesIter;
pub use UnsortedRankedNodesIter;
pub use PageRankConfiguration;