Skip to main content

weavatrix_graph/
lib.rs

1#![cfg_attr(not(feature = "unsafe-fast"), forbid(unsafe_code))]
2#![deny(unsafe_op_in_unsafe_fn)]
3#![cfg_attr(not(feature = "std"), no_std)]
4#![doc = include_str!("../README.md")]
5
6#[macro_use]
7extern crate alloc;
8
9pub(crate) use alloc::{
10    string::{String, ToString},
11    vec::Vec,
12};
13
14mod algo;
15mod attribute;
16mod error;
17mod filter;
18mod format;
19mod generator;
20mod graph;
21mod kind;
22mod legacy;
23mod matrix;
24mod model;
25mod operator;
26mod payload;
27mod topology;
28mod traversal_cache;
29mod undirected;
30mod view;
31mod working;
32
33pub use algo::{
34    AllPairsShortestPaths, AllPairsStrategy, AutoAllPairs, BellmanFord, Bfs, BiconnectedComponents,
35    BipartiteMatching, BipartitePartition, ChainDecomposition, ChainStep, CliqueEnumeration,
36    Coloring, Communities, Condensation, CycleEnumeration, DagTransitive, Dfs, DfsEvent,
37    DfsEventWorkspace, Dijkstra, DijkstraWorkspace, Direction, DistanceAnalytics,
38    DominanceFrontiers, Dominators, DominatorsIter, FeedbackArcSet, Hits, HitsScores,
39    IsomorphismSearch, IterativeCentrality, MaxFlow, MaximumMatching, Measure, MinCostFlow,
40    PathEnumeration, SignedPath, SpanningForest, SteinerTree, StoerWagnerCut, SubgraphMode,
41    TraversalControl, TraversalWorkspace, UndirectedCuts, WeightedPath, all_pairs_auto,
42    all_pairs_auto_filtered, all_simple_paths, astar, astar_filtered, bellman_ford,
43    bellman_ford_filtered, bellman_ford_measure, bellman_ford_measure_filtered,
44    betweenness_centrality, bfs, bfs_filtered, bfs_iter, bfs_iter_filtered, biconnected_components,
45    biconnected_components_filtered, bidirectional_dijkstra, bipartite_partition,
46    bridges_and_articulation_points, center, chain_decomposition, chain_decomposition_filtered,
47    chain_decomposition_from, chain_decomposition_from_filtered, closeness_centrality,
48    condensation, condensation_filtered, cycle_basis, dag_longest_path, dag_longest_path_filtered,
49    dag_longest_path_length, dag_longest_path_length_filtered, dag_transitive_reduction_closure,
50    dag_transitive_reduction_closure_filtered, dag_weighted_longest_path,
51    dag_weighted_longest_path_length, degree_centrality, depth_first_search,
52    depth_first_search_filtered, dfs, dfs_filtered, dfs_iter, dfs_iter_filtered, diameter,
53    dijkstra, dijkstra_filtered, dijkstra_iter, dijkstra_iter_filtered, dijkstra_measure,
54    dijkstra_measure_filtered, distance_analytics, distance_analytics_filtered,
55    dominance_frontiers, dominance_frontiers_filtered, dominators, dominators_filtered,
56    dsatur_coloring, eccentricity, edge_betweenness_centrality,
57    edge_betweenness_centrality_filtered, edmonds_karp, eigenvector_centrality,
58    feedback_arc_set_heuristic, find_cycle, find_cycle_filtered, floyd_warshall,
59    floyd_warshall_filtered, graph_isomorphic, has_cycle, has_cycle_filtered, hits, hits_filtered,
60    johnson_all_pairs, johnson_all_pairs_filtered, johnson_cycles, k_core_numbers,
61    k_shortest_paths, katz_centrality, label_propagation_communities, maximal_cliques,
62    maximum_bipartite_matching, maximum_flow, maximum_matching, min_cost_max_flow,
63    minimum_spanning_forest, page_rank, page_rank_filtered, periphery, prim_spanning_forest,
64    push_relabel, radius, reachable, reachable_filtered, shortest_path, shortest_path_filtered,
65    spfa, spfa_filtered, steiner_tree_approximation, stoer_wagner_min_cut,
66    stoer_wagner_min_cut_filtered, strongly_connected_components,
67    strongly_connected_components_filtered, subgraph_isomorphisms, topological_generations,
68    topological_generations_filtered, topological_sort, topological_sort_filtered,
69    undirected_edge_betweenness_centrality, undirected_edge_betweenness_centrality_filtered,
70    weakly_connected_components, weakly_connected_components_filtered,
71};
72#[cfg(feature = "rayon")]
73pub use algo::{
74    betweenness_centrality_parallel, bfs_batch_parallel, closeness_centrality_parallel,
75    dijkstra_batch_parallel, edge_betweenness_centrality_parallel, johnson_all_pairs_parallel,
76    undirected_edge_betweenness_centrality_parallel,
77};
78pub use attribute::{AttributeValue, FiniteF64};
79pub use error::{GraphError, Result};
80pub use filter::EdgeFilter;
81pub use format::{
82    GraphMlTopology, graph6_decode, graph6_encode, graphml_decode, topology_from_dot,
83    topology_to_dot, topology_to_graphml, undirected_from_dot, undirected_to_dot,
84    undirected_to_graphml,
85};
86pub use generator::{
87    RandomGraphGenerator, complete_bipartite_topology, complete_topology, cycle_topology,
88    grid_topology, path_topology, star_topology,
89};
90pub use graph::{Graph, GraphBuilder, GraphNodeIndex};
91pub use kind::{EdgeKind, EvidenceKind, NodeKind};
92pub use legacy::{LegacyGraph, LegacyLink, LegacyNode, LegacyPoint, LegacyRange};
93pub use matrix::{BitMatrix, DenseMatrix};
94pub use model::{Confidence, Edge, Node, NodeId, Provenance, SourcePosition, SourceSpan};
95pub use operator::{TopologyProjection, complement, union};
96pub use payload::{
97    AcyclicPayloadGraph, FrozenPayloadGraph, FrozenUndirectedPayloadGraph, KeyedPayloadGraph,
98    PayloadFreezeMap, PayloadGraph, StablePayloadGraph, StableUndirectedPayloadGraph,
99    UndirectedPayloadGraph,
100};
101pub use topology::{EdgeEndpoints, EdgeIndex, GraphView, IndexGraphView, NodeIndex, Topology};
102pub use traversal_cache::{
103    CacheBfs, CacheDfs, NeighborIter, TraversalCache, TraversalCacheWorkspace, TraversalLayout,
104    TraversalStorage,
105};
106pub use undirected::{IndexUndirectedGraphView, UndirectedGraphView, UndirectedTopology};
107pub use view::{
108    EdgeFiltered, NodeFiltered, Reversed, edge_filtered, induced_subgraph_view, reversed,
109};
110pub use working::{FreezeMap, FrozenGraph, StableEdgeKey, StableNodeKey, WorkingGraph};