pub struct GraphHash { /* private fields */ }Expand description
| graph with nodes having integral indices | that shouldn’t be between 0 and n-1 will | be used to store MinimumUnionCycles and subgraphs |
Implementations§
Source§impl GraphHash
impl GraphHash
pub fn clear_parents(&mut self)
pub fn clear_node_parents(&mut self, node: NodeId)
pub fn parents_for_node(&self, v_n: NodeId) -> Vec<NodeId>
pub fn num_parents_for_node(&self, v_n: NodeId) -> usize
pub fn set_single_parent(&mut self, node: NodeId, parent: NodeId)
pub fn set_parents_for_node(&mut self, node: NodeId, parents: Vec<NodeId>)
pub fn has_parent(&self, node: NodeId, candidate: NodeId) -> bool
pub fn add_parent(&mut self, node: NodeId, parent: NodeId)
pub fn reinit_parents(&mut self, len: usize)
pub fn fill_to_len(&mut self, len: usize, val: Vec<NodeId>)
Source§impl GraphHash
impl GraphHash
pub fn distance_is_farther_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_farther_than_one_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_one_step_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_infinite(&self, node: NodeId) -> bool
pub fn distance(&self, node: NodeId) -> f64
pub fn set_distance_for_node(&mut self, node: NodeId, val: f64)
pub fn set_distance_one_step_away(&mut self, dst: NodeId, src: NodeId)
pub fn set_distance_zero(&mut self, source: NodeId)
pub fn distance_reinit(&mut self, len: usize)
Source§impl GraphHash
impl GraphHash
pub fn sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn sigma_set_node_to_zero(&mut self, node: NodeId)
pub fn sigma_set_node_to_one(&mut self, node: NodeId)
pub fn increment_sigma_value_for_node(&mut self, v_n: NodeId, c_t: f64)
pub fn reinit_sigmas(&mut self, len: usize)
pub fn sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn fill_sigmas(&mut self, val: f64)
Source§impl GraphHash
impl GraphHash
pub fn new_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn new_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)
pub fn new_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)
pub fn new_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64
pub fn new_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)
pub fn new_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn reinit_new_sigmas(&mut self, len: usize)
pub fn new_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn new_sigmas_fill_sigmas(&mut self, val: f64)
Source§impl GraphHash
impl GraphHash
pub fn visited(&self, id: NodeId) -> bool
pub fn unvisited(&self, id: NodeId) -> bool
pub fn visit(&mut self, id: NodeId)
pub fn unvisit(&mut self, id: NodeId)
pub fn reinit_visit_markers(&mut self, len: usize)
pub fn fill_visit_markers(&mut self, val: bool)
pub fn fill_visit_markers_to_len(&mut self, len: usize, val: bool)
Source§impl GraphHash
impl GraphHash
pub fn pair_dependency_for_node(&self, node: NodeId) -> f64
pub fn set_pair_dependency_for_node(&mut self, node: NodeId, val: f64)
pub fn reinit_pair_dependencies(&mut self, len: usize)
pub fn increment_pair_dependency_for_node(&mut self, node: NodeId, val: f64)
Source§impl GraphHash
impl GraphHash
pub fn new_pair_dependencies_pair_dependency_for_node( &self, node: NodeId, ) -> f64
pub fn new_pair_dependencies_set_pair_dependency_for_node( &mut self, node: NodeId, val: f64, )
pub fn new_pair_dependencies_reinit(&mut self, len: usize)
pub fn new_pair_dependencies_increment_pair_dependency_for_node( &mut self, node: NodeId, val: f64, )
Source§impl GraphHash
impl GraphHash
pub fn increment_path_count_for_node(&mut self, node: NodeId, val: usize)
pub fn increment_path_count_for_node_from( &mut self, node: NodeId, other: NodeId, )
pub fn update_path_counts(&mut self, dst: NodeId, src: NodeId)
pub fn path_count_for_node(&self, node: NodeId) -> usize
pub fn set_path_count_for_node(&mut self, node: NodeId, count: usize)
pub fn path_count_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn set_path_count_to_one(&mut self, source: NodeId)
pub fn set_path_count_to_zero(&mut self, source: NodeId)
pub fn path_counts_reinit(&mut self, len: usize)
Source§impl GraphHash
impl GraphHash
pub fn new_path_counts_increment_path_count_for_node( &mut self, node: NodeId, val: usize, )
pub fn new_path_counts_increment_path_count_for_node_from( &mut self, node: NodeId, other: NodeId, )
pub fn new_path_counts_update_path_counts(&mut self, dst: NodeId, src: NodeId)
pub fn new_path_counts_path_count_for_node(&self, node: NodeId) -> usize
pub fn new_path_counts_set_path_count_for_node( &mut self, node: NodeId, count: usize, )
pub fn new_path_counts_path_count_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn new_path_counts_set_path_count_to_one(&mut self, source: NodeId)
pub fn new_path_counts_set_path_count_to_zero(&mut self, source: NodeId)
pub fn new_path_counts_reinit(&mut self, len: usize)
Source§impl GraphHash
impl GraphHash
pub fn inc_path_counts_increment_path_count_for_node( &mut self, node: NodeId, val: usize, )
pub fn inc_path_counts_increment_path_count_for_node_from( &mut self, node: NodeId, other: NodeId, )
pub fn inc_path_counts_update_path_counts(&mut self, dst: NodeId, src: NodeId)
pub fn inc_path_counts_path_count_for_node(&self, node: NodeId) -> usize
pub fn inc_path_counts_set_path_count_for_node( &mut self, node: NodeId, count: usize, )
pub fn inc_path_counts_path_count_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn inc_path_counts_set_path_count_to_one(&mut self, source: NodeId)
pub fn inc_path_counts_set_path_count_to_zero(&mut self, source: NodeId)
pub fn inc_path_counts_reinit(&mut self, len: usize)
Source§impl GraphHash
impl GraphHash
pub fn nodeid_range(&self) -> Vec<NodeId>
pub fn limited_nodeid_range(&self, cap: Option<usize>) -> Vec<NodeId>
pub fn mapped_nodes(&self) -> Vec<NodeId>
pub fn set_neighbors(&mut self, node: NodeId, nbrs: Vec<NodeId>)
pub fn add_neighbor(&mut self, node: NodeId, nbr: NodeId)
pub fn has_map_for_node(&self, node: NodeId) -> bool
pub fn remove_node_and_neighbors(&mut self, node: NodeId)
pub fn neighbors(&self, node: NodeId) -> Neighbors
pub fn extend_mapped_nodes(&mut self, other: &NeighborsMap)
pub fn nodes_map_unlink_all(&mut self, src: NodeId, dst: NodeId)
pub fn nodes_map_add_edge(&mut self, e: &Edge)
pub fn nodes_map_unlink_edge(&mut self, e: &Edge)
pub fn nodes_map_reinit(&mut self, len: usize)
pub fn nodes_map_clear(&mut self)
pub fn nodes_map_add_isolated_node(&mut self, node: NodeId)
pub fn num_edges(&self) -> usize
pub fn clear_edges(&mut self)
pub fn has_edge(&self, edge: &Edge) -> bool
pub fn connects(&self, src: NodeId, dst: NodeId) -> bool
pub fn unlink_all_edges_between(&mut self, src: NodeId, dst: NodeId)
pub fn edges_to_node(&self, src: NodeId) -> Vec<Edge>
pub fn edges_from_node(&self, src: NodeId) -> Vec<Edge>
Source§impl GraphHash
impl GraphHash
Sourcepub fn fill_edges_from_bfs(
&mut self,
parent: &GraphHash,
id: NodeId,
visited_map: &mut VisitMarkers,
)
pub fn fill_edges_from_bfs( &mut self, parent: &GraphHash, id: NodeId, visited_map: &mut VisitMarkers, )
do a BFS from id, count the number of vertices, and mark the visited
pub fn new_via_bfs_from_id( name: &str, parent: &GraphHash, id: NodeId, visited_map: &mut VisitMarkers, ) -> Self
pub fn maybe_set_distance_for_neighbor(&mut self, w: NodeId, v: NodeId)
pub fn maybe_increment_path_count_and_add_parent_for_neighbor( &mut self, w: NodeId, v: NodeId, )
pub fn update_dist_and_path_for_neighbors(&mut self, v: NodeId)
pub fn update_pair_dependencies(&mut self, w: NodeId, v: NodeId)
pub fn update_parent_pair_dependencies_and_increment_score_for_node( &mut self, w: NodeId, s: NodeId, scores: &mut BetweennessScores, )
pub fn conn_comp_sizes_step( &self, visited_map: &mut VisitMarkers, id: NodeId, out_vec: &mut Vec<i32>, )
pub fn find_single_source_shortest_paths_step( &self, v: NodeId, id: NodeId, single_source_shortest_paths: &mut DistanceMap, queue: &mut NodeIdQueue, )
Trait Implementations§
Source§impl BrandesIterInit for GraphHash
impl BrandesIterInit for GraphHash
fn brandes_iter_init(&mut self, s: NodeId)
Source§impl BrandesIterUpdateDistancesAndPathForNeighbors for GraphHash
impl BrandesIterUpdateDistancesAndPathForNeighbors for GraphHash
fn brandes_iter_update_dist_and_path_for_neighbors(&mut self, s: NodeId)
Source§impl BrandesIterUpdatePairDependenciesAndFill for GraphHash
impl BrandesIterUpdatePairDependenciesAndFill for GraphHash
fn brandes_iter_update_pair_dependencies_and_fill( &mut self, s: NodeId, scores: &mut BetweennessScores, ) -> Result<(), BetweennessCentralityError>
Source§impl DebugIterationStep for GraphHash
impl DebugIterationStep for GraphHash
fn dbg_iteration_step( &mut self, v_s: &mut Vec<NodeId>, ) -> Result<(), BetweennessCentralityError>
Source§impl ExtendWith<GraphHash> for GraphHash
impl ExtendWith<GraphHash> for GraphHash
Source§impl FindConnectedComponents<GraphHash> for GraphHash
impl FindConnectedComponents<GraphHash> for GraphHash
Source§impl FindPruningCounts for GraphHash
impl FindPruningCounts for GraphHash
fn find_pruning_counts_exp( &mut self, src: NodeId, dst: NodeId, ) -> Result<(i32, i32, i32), BetweennessCentralityError>
Source§impl FindSingleSourceShortestPaths for GraphHash
impl FindSingleSourceShortestPaths for GraphHash
fn find_single_source_shortest_paths( &self, id: NodeId, ) -> Result<DistanceMap, BetweennessCentralityError>
Source§impl GetConnectedComponentSizes for GraphHash
impl GetConnectedComponentSizes for GraphHash
Source§fn conn_comp_sizes(&self) -> Result<Vec<i32>, BetweennessCentralityError>
fn conn_comp_sizes(&self) -> Result<Vec<i32>, BetweennessCentralityError>
| the vector @out_vec will have sizes | of the connected components in the graph |
Source§impl GetNodeIdRange for GraphHash
impl GetNodeIdRange for GraphHash
fn nodeid_range(&self) -> Vec<NodeId>
Source§impl GetPrintNodes for GraphHash
impl GetPrintNodes for GraphHash
fn get_print_nodes(&self) -> bool
Source§impl GetSigmaValueForNode for GraphHash
impl GetSigmaValueForNode for GraphHash
fn sigma_value_for_node(&self, node: NodeId) -> f64
Source§impl HasMapForNode for GraphHash
impl HasMapForNode for GraphHash
fn has_map_for_node(&self, id: NodeId) -> bool
Source§impl InitDebugIteration for GraphHash
impl InitDebugIteration for GraphHash
fn init_dbg_iteration(&mut self, source: NodeId)
Source§impl InsertEdge for GraphHash
impl InsertEdge for GraphHash
fn insert_edge(&mut self, edge: &Edge) -> Result<(), BetweennessCentralityError>
Source§impl InsertNode for GraphHash
impl InsertNode for GraphHash
fn insert_node(&mut self, id: NodeId)
Source§impl MappedNodes for GraphHash
impl MappedNodes for GraphHash
fn mapped_nodes(&self) -> Vec<NodeId>
Source§impl NewFromCycleVec for GraphHash
impl NewFromCycleVec for GraphHash
Source§impl<G> NewFromGraphRef<G> for GraphHashwhere
G: GetEdges,
impl<G> NewFromGraphRef<G> for GraphHashwhere
G: GetEdges,
fn new_from_graph_ref(graph: &G, name: &str) -> Self
Source§impl PairDependencyForNode for GraphHash
impl PairDependencyForNode for GraphHash
fn pair_dependency_for_node(&self, node: NodeId) -> f64
Source§impl ParentsForNode for GraphHash
impl ParentsForNode for GraphHash
Source§impl PathCountForNode for GraphHash
impl PathCountForNode for GraphHash
fn path_count_for_node(&self, node: NodeId) -> usize
fn path_count_for_node_ref(&self, node: NodeId) -> &usize
fn path_count_for_node_mut(&mut self, node: NodeId) -> &mut usize
Source§impl ReinitMaps for GraphHash
impl ReinitMaps for GraphHash
fn reinit_maps(&mut self)
Source§impl ReinitMapsForNode for GraphHash
impl ReinitMapsForNode for GraphHash
fn reinit_maps_for_node(&mut self, k: NodeId)
Source§impl RemoveBridges for GraphHash
impl RemoveBridges for GraphHash
fn remove_bridges(&mut self, bridge_vec: Vec<Edge>)
Source§impl RemoveEdge for GraphHash
impl RemoveEdge for GraphHash
fn remove_edge(&mut self, edge: &Edge) -> Result<(), BetweennessCentralityError>
Source§impl SetPairDependencyForNode for GraphHash
impl SetPairDependencyForNode for GraphHash
fn set_pair_dependency_for_node(&mut self, node: NodeId, val: f64)
Source§impl SetPrintNodes for GraphHash
impl SetPrintNodes for GraphHash
fn set_print_nodes(&self, val: bool)
Source§impl SetSigmaValueForNode for GraphHash
impl SetSigmaValueForNode for GraphHash
fn set_sigma_value_for_node(&mut self, node: NodeId, val: f64)
Source§impl SpawnScores for GraphHash
impl SpawnScores for GraphHash
fn spawn_scores(&self) -> BetweennessScores
Auto Trait Implementations§
impl !Freeze for GraphHash
impl RefUnwindSafe for GraphHash
impl Send for GraphHash
impl Sync for GraphHash
impl Unpin for GraphHash
impl UnwindSafe for GraphHash
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
Source§impl<G> FindArticulationPoints for G
impl<G> FindArticulationPoints for G
Source§fn find_articulation_points(&self, out_vec: &mut Vec<NodeId>)
fn find_articulation_points(&self, out_vec: &mut Vec<NodeId>)
| This function will return a vector of | the articulation points. | | If an articulation point appears in | more than two biconnected components | it will appear more than once (number | of bcc’s it appears in -1) |
fn articulation_point_dfs_visitor<'a>( &self, u: NodeId, ctx: &mut ArticulationPointFinderContext<'a>, articulation_point_vec: &mut Vec<NodeId>, ) -> Result<(), BetweennessCentralityError>
fn articulation_point_dfs_visitor_step_tree_edge<'a>( &self, v: NodeId, u: NodeId, ctx: &mut ArticulationPointFinderContext<'a>, articulation_point_vec: &mut Vec<NodeId>, tree_edge_cnt: &mut i32, ) -> Result<(), BetweennessCentralityError>
Source§impl<T> FindBiconnectedComponent for T
impl<T> FindBiconnectedComponent for T
fn find_bicon_component<GH>(&mut self, out_vec: &mut Vec<GH>)where
GH: BccGraphHashInterface,
Source§impl<G> FindBridgeEdges for Gwhere
G: FindBiconnectedComponent,
impl<G> FindBridgeEdges for Gwhere
G: FindBiconnectedComponent,
Source§fn find_bridge_edges<GH>(&mut self) -> Vec<Edge>where
GH: BccGraphHashInterface,
fn find_bridge_edges<GH>(&mut self) -> Vec<Edge>where
GH: BccGraphHashInterface,
the single edge in a size 2 bcc is a bridge
Source§impl<T> FindEdgeBccSubgraph for T
impl<T> FindEdgeBccSubgraph for T
Source§fn find_edge_bcc_subgraph<GH>(
&mut self,
bcc: &mut GH,
edge: &Edge,
) -> Result<(), BetweennessCentralityError>where
GH: BccGraphHashInterface,
fn find_edge_bcc_subgraph<GH>(
&mut self,
bcc: &mut GH,
edge: &Edge,
) -> Result<(), BetweennessCentralityError>where
GH: BccGraphHashInterface,
| the edge (@src, @dst) must be in the graph | the biconnected component subgraph that | contains the passed edge will be returned | in @bcc | | IMP assumption: | | the input graph is connected, and the edge | (src, dst) is inserted, so the edge (src, | dst) is part of a cycle, so both ends | belong to the same bcc | |IMP: (src,dst) must exist!
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PoisonMessage for Twhere
T: Debug,
impl<T> PoisonMessage for Twhere
T: Debug,
fn poison_message(&self) -> String
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.