pub struct NormalizedGraph {
pub raw: RawGraph,
pub condensed: DiGraph<SccNode, ()>,
pub reduced: DiGraph<SccNode, ()>,
pub item_to_scc: HashMap<String, NodeIndex>,
}Expand description
Fields§
§raw: RawGraphOriginal graph from SQLite (may contain cycles).
condensed: DiGraph<SccNode, ()>Condensed DAG: SCCs collapsed to single nodes.
reduced: DiGraph<SccNode, ()>Transitively-reduced condensed DAG (minimum edge set).
item_to_scc: HashMap<String, NodeIndex>Mapping from item ID to condensed node index.
Implementations§
Source§impl NormalizedGraph
impl NormalizedGraph
Sourcepub fn from_raw(raw: RawGraph) -> Self
pub fn from_raw(raw: RawGraph) -> Self
Build a NormalizedGraph from a RawGraph.
Steps:
- Run petgraph’s SCC condensation (Tarjan’s algorithm internally).
- Build
SccNodelabels from the raw node weights. - Compute transitive reduction of the condensed DAG.
§Panics
Does not panic — all indices are verified.
Sourcepub fn cycle_count(&self) -> usize
pub fn cycle_count(&self) -> usize
Return the number of cycle SCCs (SCCs with more than one member).
Sourcepub fn cyclic_items(&self) -> Vec<&str>
pub fn cyclic_items(&self) -> Vec<&str>
Return all items that are members of a dependency cycle.
Sourcepub fn scc_of(&self, item_id: &str) -> Option<NodeIndex>
pub fn scc_of(&self, item_id: &str) -> Option<NodeIndex>
Return the SCC node index for a given item ID.
Sourcepub fn content_hash(&self) -> &str
pub fn content_hash(&self) -> &str
Return the content hash from the underlying raw graph.
Used for cache invalidation — if this changes, rebuild.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NormalizedGraph
impl RefUnwindSafe for NormalizedGraph
impl Send for NormalizedGraph
impl Sync for NormalizedGraph
impl Unpin for NormalizedGraph
impl UnsafeUnpin for NormalizedGraph
impl UnwindSafe for NormalizedGraph
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
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<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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.