Skip to main content

Crate use_graph

Crate use_graph 

Source
Expand description

Thin facade for the use-graph workspace.

The crate reexports the focused graph crates directly so consumers can opt into one dependency while still using the smaller APIs.

§Examples

use use_graph::*;

let adjacency = build_directed_adjacency(4, &[(0, 1), (1, 2), (0, 3)]).unwrap();
let path = shortest_path_unweighted(&adjacency, 0, 2).unwrap().unwrap();
let edge = WeightedEdge::new(0, 1, 1.5).unwrap();

assert_eq!(path.nodes(), &[0, 1, 2]);
assert_eq!(path_weight(&[edge]).unwrap(), 1.5);
assert_eq!(max_degree(&adjacency), Some(2));

Re-exports§

pub use use_adjacency;
pub use use_edge;
pub use use_graph_metrics;
pub use use_graph_path;
pub use use_graph_traversal;
pub use use_node;
pub use use_weighted_graph;

Structs§

DirectedEdge
Edge
NodeId
Path
UndirectedEdge
WeightedEdge

Enums§

AdjacencyError
PathError
TraversalError
WeightedGraphError

Functions§

average_degree
breadth_first_order
build_directed_adjacency
build_undirected_adjacency
build_weighted_directed_adjacency
build_weighted_undirected_adjacency
connected_component
contains_node
dedupe_edges
degree
degrees
density_directed
density_undirected
depth_first_order
edge_count_directed
edge_count_undirected
has_edge
has_self_loop
is_valid_path
max_degree
max_weight_edge
min_degree
min_weight_edge
neighbors
node_count
node_ids
path_weight
reachable
shortest_path_unweighted
unique_nodes

Type Aliases§

AdjacencyList
WeightedAdjacencyList