Struct GraphHash

Source
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

Source

pub fn clear_parents(&mut self)

Source

pub fn clear_node_parents(&mut self, node: NodeId)

Source

pub fn parents_for_node(&self, v_n: NodeId) -> Vec<NodeId>

Source

pub fn num_parents_for_node(&self, v_n: NodeId) -> usize

Source

pub fn set_single_parent(&mut self, node: NodeId, parent: NodeId)

Source

pub fn set_parents_for_node(&mut self, node: NodeId, parents: Vec<NodeId>)

Source

pub fn has_parent(&self, node: NodeId, candidate: NodeId) -> bool

Source

pub fn add_parent(&mut self, node: NodeId, parent: NodeId)

Source

pub fn reinit_parents(&mut self, len: usize)

Source

pub fn fill_to_len(&mut self, len: usize, val: Vec<NodeId>)

Source§

impl GraphHash

Source

pub fn distance_is_farther_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_farther_than_one_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_one_step_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_infinite(&self, node: NodeId) -> bool

Source

pub fn distance(&self, node: NodeId) -> f64

Source

pub fn set_distance_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn set_distance_one_step_away(&mut self, dst: NodeId, src: NodeId)

Source

pub fn set_distance_zero(&mut self, source: NodeId)

Source

pub fn distance_reinit(&mut self, len: usize)

Source§

impl GraphHash

Source

pub fn sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn sigma_set_node_to_zero(&mut self, node: NodeId)

Source

pub fn sigma_set_node_to_one(&mut self, node: NodeId)

Source

pub fn increment_sigma_value_for_node(&mut self, v_n: NodeId, c_t: f64)

Source

pub fn reinit_sigmas(&mut self, len: usize)

Source

pub fn sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn fill_sigmas(&mut self, val: f64)

Source§

impl GraphHash

Source

pub fn new_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn new_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)

Source

pub fn new_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)

Source

pub fn new_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64

Source

pub fn new_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn new_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )

Source

pub fn reinit_new_sigmas(&mut self, len: usize)

Source

pub fn new_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn new_sigmas_fill_sigmas(&mut self, val: f64)

Source§

impl GraphHash

Source

pub fn visited(&self, id: NodeId) -> bool

Source

pub fn unvisited(&self, id: NodeId) -> bool

Source

pub fn visit(&mut self, id: NodeId)

Source

pub fn unvisit(&mut self, id: NodeId)

Source

pub fn reinit_visit_markers(&mut self, len: usize)

Source

pub fn fill_visit_markers(&mut self, val: bool)

Source

pub fn fill_visit_markers_to_len(&mut self, len: usize, val: bool)

Source§

impl GraphHash

Source

pub fn queue_len(&self) -> usize

Source

pub fn enqueue(&mut self, n: NodeId)

Source

pub fn dequeue(&mut self) -> Option<NodeId>

Source§

impl GraphHash

Source

pub fn stack_push(&mut self, n: NodeId)

Source

pub fn stack_pop(&mut self) -> Option<NodeId>

Source

pub fn stack_len(&self) -> usize

Source

pub fn stack_node_at_index(&self, idx: usize) -> NodeId

Source

pub fn stack_set_node_at_index(&mut self, idx: usize, n: NodeId)

Source§

impl GraphHash

Source

pub fn pair_dependency_for_node(&self, node: NodeId) -> f64

Source

pub fn set_pair_dependency_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn reinit_pair_dependencies(&mut self, len: usize)

Source

pub fn increment_pair_dependency_for_node(&mut self, node: NodeId, val: f64)

Source§

impl GraphHash

Source§

impl GraphHash

Source

pub fn increment_path_count_for_node(&mut self, node: NodeId, val: usize)

Source

pub fn increment_path_count_for_node_from( &mut self, node: NodeId, other: NodeId, )

Source

pub fn update_path_counts(&mut self, dst: NodeId, src: NodeId)

Source

pub fn path_count_for_node(&self, node: NodeId) -> usize

Source

pub fn set_path_count_for_node(&mut self, node: NodeId, count: usize)

Source

pub fn path_count_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn set_path_count_to_one(&mut self, source: NodeId)

Source

pub fn set_path_count_to_zero(&mut self, source: NodeId)

Source

pub fn path_counts_reinit(&mut self, len: usize)

Source§

impl GraphHash

Source§

impl GraphHash

Source§

impl GraphHash

Source

pub fn nodeid_range(&self) -> Vec<NodeId>

Source

pub fn limited_nodeid_range(&self, cap: Option<usize>) -> Vec<NodeId>

Source

pub fn mapped_nodes(&self) -> Vec<NodeId>

Source

pub fn set_neighbors(&mut self, node: NodeId, nbrs: Vec<NodeId>)

Source

pub fn add_neighbor(&mut self, node: NodeId, nbr: NodeId)

Source

pub fn has_map_for_node(&self, node: NodeId) -> bool

Source

pub fn remove_node_and_neighbors(&mut self, node: NodeId)

Source

pub fn neighbors(&self, node: NodeId) -> Neighbors

Source

pub fn extend_mapped_nodes(&mut self, other: &NeighborsMap)

Source

pub fn nodes_map_add_edge(&mut self, e: &Edge)

Source

pub fn nodes_map_reinit(&mut self, len: usize)

Source

pub fn nodes_map_clear(&mut self)

Source

pub fn nodes_map_add_isolated_node(&mut self, node: NodeId)

Source

pub fn num_edges(&self) -> usize

Source

pub fn clear_edges(&mut self)

Source

pub fn has_edge(&self, edge: &Edge) -> bool

Source

pub fn connects(&self, src: NodeId, dst: NodeId) -> bool

Source

pub fn edges_to_node(&self, src: NodeId) -> Vec<Edge>

Source

pub fn edges_from_node(&self, src: NodeId) -> Vec<Edge>

Source§

impl GraphHash

Source

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

Source

pub fn new_via_bfs_from_id( name: &str, parent: &GraphHash, id: NodeId, visited_map: &mut VisitMarkers, ) -> Self

Source

pub fn maybe_set_distance_for_neighbor(&mut self, w: NodeId, v: NodeId)

Source

pub fn maybe_increment_path_count_and_add_parent_for_neighbor( &mut self, w: NodeId, v: NodeId, )

Source

pub fn update_dist_and_path_for_neighbors(&mut self, v: NodeId)

Source

pub fn update_pair_dependencies(&mut self, w: NodeId, v: NodeId)

Source

pub fn update_parent_pair_dependencies_and_increment_score_for_node( &mut self, w: NodeId, s: NodeId, scores: &mut BetweennessScores, )

Source

pub fn conn_comp_sizes_step( &self, visited_map: &mut VisitMarkers, id: NodeId, out_vec: &mut Vec<i32>, )

Source

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

Source§

impl BrandesIterUpdateDistancesAndPathForNeighbors for GraphHash

Source§

impl BrandesIterUpdatePairDependenciesAndFill for GraphHash

Source§

impl CreateNamedEmpty for GraphHash

Source§

fn empty(name: &str) -> Self

Source§

impl Debug for GraphHash

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DebugIterationStep for GraphHash

Source§

impl ExtendWith<GraphHash> for GraphHash

Source§

impl FindConnectedComponents<GraphHash> for GraphHash

Source§

impl FindPruningCounts for GraphHash

Source§

impl FindSingleSourceShortestPaths for GraphHash

Source§

impl GetConnectedComponentSizes for GraphHash

Source§

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 GetEdges for GraphHash

Source§

fn edges(&self) -> &Edges

Source§

impl GetNeighborsForNode for GraphHash

Source§

fn neighbors(&self, id: NodeId) -> Vec<NodeId>

Source§

impl GetNodeIdRange for GraphHash

Source§

impl GetPrintNodes for GraphHash

Source§

impl GetSigmaValueForNode for GraphHash

Source§

impl HasEdge for GraphHash

Source§

fn has_edge(&self, e: &Edge) -> bool

Source§

impl HasMapForNode for GraphHash

Source§

impl InitDebugIteration for GraphHash

Source§

fn init_dbg_iteration(&mut self, source: NodeId)

Source§

impl InsertEdge for GraphHash

Source§

impl InsertNode for GraphHash

Source§

fn insert_node(&mut self, id: NodeId)

Source§

impl MappedNodes for GraphHash

Source§

impl Named for GraphHash

Source§

fn name(&self) -> Cow<'_, str>

Returns the name associated with self. We use Cow to allow both owned and borrowed strings.
Source§

impl NewFromCycleVec for GraphHash

Source§

fn new_from_cycle_vec(cycle_vec: &Vec<Cycle>, name: &str) -> Self

Source§

impl<G> NewFromGraphRef<G> for GraphHash
where G: GetEdges,

Source§

fn new_from_graph_ref(graph: &G, name: &str) -> Self

Source§

impl NumEdges for GraphHash

Source§

impl NumNodes for GraphHash

Source§

impl PairDependencyForNode for GraphHash

Source§

impl ParentsForNode for GraphHash

Source§

impl PathCountForNode for GraphHash

Source§

impl ReinitMaps for GraphHash

Source§

fn reinit_maps(&mut self)

Source§

impl ReinitMapsForNode for GraphHash

Source§

impl RemoveBridges for GraphHash

Source§

fn remove_bridges(&mut self, bridge_vec: Vec<Edge>)

Source§

impl RemoveEdge for GraphHash

Source§

impl ResetWith<GraphHash> for GraphHash

Source§

fn reset_with(&mut self, g: &GraphHash)

Source§

impl SetPairDependencyForNode for GraphHash

Source§

impl SetPrintNodes for GraphHash

Source§

impl SetSigmaValueForNode for GraphHash

Source§

fn set_sigma_value_for_node(&mut self, node: NodeId, val: f64)

Source§

impl SpawnScores for GraphHash

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<G> FindArticulationPoints for G

Source§

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) |

Source§

fn articulation_point_dfs_visitor<'a>( &self, u: NodeId, ctx: &mut ArticulationPointFinderContext<'a>, articulation_point_vec: &mut Vec<NodeId>, ) -> Result<(), BetweennessCentralityError>

Source§

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

Source§

fn find_bicon_component<GH>(&mut self, out_vec: &mut Vec<GH>)

Source§

impl<G> FindBridgeEdges for G

Source§

fn find_bridge_edges<GH>(&mut self) -> Vec<Edge>

the single edge in a size 2 bcc is a bridge

Source§

impl<T> FindEdgeBccSubgraph for T

Source§

fn find_edge_bcc_subgraph<GH>( &mut self, bcc: &mut GH, edge: &Edge, ) -> Result<(), BetweennessCentralityError>

| 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PoisonMessage for T
where T: Debug,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> BccGraphHashInterface for T

Source§

impl<T> GraphHashMucInterface for T