pub struct GraphAlgorithms;Expand description
グラフアルゴリズムマネージャー
Implementations§
Source§impl GraphAlgorithms
impl GraphAlgorithms
Sourcepub fn shortest_path_dijkstra(
graph: &Graph,
source: VertexId,
weight_fn: impl Fn(&EdgeData) -> u64,
) -> Result<ShortestPathResult>
pub fn shortest_path_dijkstra( graph: &Graph, source: VertexId, weight_fn: impl Fn(&EdgeData) -> u64, ) -> Result<ShortestPathResult>
Dijkstraのアルゴリズムで最短経路を計算
Sourcepub fn shortest_path_bellman_ford(
graph: &Graph,
source: VertexId,
weight_fn: impl Fn(&EdgeData) -> u64,
) -> Result<ShortestPathResult>
pub fn shortest_path_bellman_ford( graph: &Graph, source: VertexId, weight_fn: impl Fn(&EdgeData) -> u64, ) -> Result<ShortestPathResult>
Bellman-Fordアルゴリズム(負の重み対応)
Sourcepub fn all_pairs_shortest_paths(
graph: &Graph,
weight_fn: impl Fn(&EdgeData) -> u64,
) -> Result<HashMap<(VertexId, VertexId), u64>>
pub fn all_pairs_shortest_paths( graph: &Graph, weight_fn: impl Fn(&EdgeData) -> u64, ) -> Result<HashMap<(VertexId, VertexId), u64>>
Floyd-Warshallアルゴリズム(全頂点間最短経路)
Sourcepub fn shortest_path_astar(
graph: &Graph,
source: VertexId,
target: VertexId,
weight_fn: impl Fn(&EdgeData) -> u64,
heuristic_fn: impl Fn(VertexId, VertexId) -> u64,
) -> Result<Option<Vec<VertexId>>>
pub fn shortest_path_astar( graph: &Graph, source: VertexId, target: VertexId, weight_fn: impl Fn(&EdgeData) -> u64, heuristic_fn: impl Fn(VertexId, VertexId) -> u64, ) -> Result<Option<Vec<VertexId>>>
A*アルゴリズム(ヒューリスティック使用)
Sourcepub fn degree_centrality(graph: &Graph, normalized: bool) -> CentralityResult
pub fn degree_centrality(graph: &Graph, normalized: bool) -> CentralityResult
次数中央性を計算
Sourcepub fn betweenness_centrality(
graph: &Graph,
normalized: bool,
) -> CentralityResult
pub fn betweenness_centrality( graph: &Graph, normalized: bool, ) -> CentralityResult
媒介中央性を計算(Brandesのアルゴリズム)
Sourcepub fn closeness_centrality(graph: &Graph, normalized: bool) -> CentralityResult
pub fn closeness_centrality(graph: &Graph, normalized: bool) -> CentralityResult
近接中央性を計算
Sourcepub fn pagerank(
graph: &Graph,
damping_factor: f64,
max_iterations: usize,
tolerance: f64,
) -> CentralityResult
pub fn pagerank( graph: &Graph, damping_factor: f64, max_iterations: usize, tolerance: f64, ) -> CentralityResult
PageRankを計算(べき乗法)
Sourcepub fn subgraph_isomorphism(
pattern: &Graph,
target: &Graph,
) -> PatternMatchResult
pub fn subgraph_isomorphism( pattern: &Graph, target: &Graph, ) -> PatternMatchResult
基本的な部分グラフ同型マッチング(Ullmannのアルゴリズム簡易版)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphAlgorithms
impl RefUnwindSafe for GraphAlgorithms
impl Send for GraphAlgorithms
impl Sync for GraphAlgorithms
impl Unpin for GraphAlgorithms
impl UnwindSafe for GraphAlgorithms
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more