pub struct TypedGraphBuilder {
pub min_degree: Option<usize>,
pub graph_id: GraphId,
}
Expand description
In the TypedGraph world, we use the type NodeLabel as an alias for the NodeId type. Internally we represent node ids with u32s of 0…n.
Fields§
§min_degree: Option<usize>
§graph_id: GraphId
Trait Implementations§
source§impl GraphBuilderBase for TypedGraphBuilder
impl GraphBuilderBase for TypedGraphBuilder
type GraphType = TypedGraph
type RowType = EdgeRow
fn from_vector(&mut self, rows: Vec<EdgeRow>) -> CLQResult<TypedGraph>
source§impl GraphBuilderBaseWithPreProcessing for TypedGraphBuilder
impl GraphBuilderBaseWithPreProcessing for TypedGraphBuilder
fn pre_process_rows( &mut self, data: Vec<<Self as GraphBuilderBase>::RowType> ) -> CLQResult<Vec<<Self as GraphBuilderBase>::RowType>>
source§impl TypedGraphBuilderBase for TypedGraphBuilder
impl TypedGraphBuilderBase for TypedGraphBuilder
fn create_graph( nodes: FxHashMap<u32, Node>, core_ids: Vec<u32>, non_core_ids: Vec<u32>, labels_map: FxHashMap<NodeLabel, u32> ) -> CLQResult<TypedGraph>
source§fn populate_edges(
rows: &[EdgeRow],
node_map: &mut FxHashMap<u32, Node>,
labels_map: &FxHashMap<NodeLabel, u32>
) -> CLQResult<()>
fn populate_edges( rows: &[EdgeRow], node_map: &mut FxHashMap<u32, Node>, labels_map: &FxHashMap<NodeLabel, u32> ) -> CLQResult<()>
given a set of initialized Nodes, populates the respective neighbors fields
appropriately.
fn init_nodes( core_ids: &[NodeLabel], non_core_ids: &[NodeLabel], non_core_type_ids: &HashMap<NodeLabel, NodeTypeId> ) -> (FxHashMap<u32, Node>, FxHashMap<NodeLabel, u32>, Vec<u32>, Vec<u32>)
source§fn trim_edges(
node_map: &mut FxHashMap<u32, Node>,
min_degree: &usize
) -> HashSet<u32>
fn trim_edges( node_map: &mut FxHashMap<u32, Node>, min_degree: &usize ) -> HashSet<u32>
Trims edges greedily, until all edges in the graph have degree at least min_degree.
Note that this function does not delete any nodes – just finds nodes to delete. It is
called by
prune
, which actually does the deletion.source§fn prune(
graph: TypedGraph,
rows: &[EdgeRow],
min_degree: usize
) -> CLQResult<TypedGraph>
fn prune( graph: TypedGraph, rows: &[EdgeRow], min_degree: usize ) -> CLQResult<TypedGraph>
Takes an already-built graph and the edge rows used to create it, returning a
new graph, where all nodes are assured to have degree at least min_degree.
The provision of a ::GraphType is necessary, since the notion of “degree” does
not make sense outside of a graph.
Auto Trait Implementations§
impl RefUnwindSafe for TypedGraphBuilder
impl Send for TypedGraphBuilder
impl Sync for TypedGraphBuilder
impl Unpin for TypedGraphBuilder
impl UnwindSafe for TypedGraphBuilder
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.