pub struct DotGraph<N: NodeStorage<NodeData = DotVertexData> = NodeStorageVec<DotVertexData>> {
pub global_data: GlobalData,
pub graph: HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>,
}Fields§
§global_data: GlobalData§graph: HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>Implementations§
Source§impl<S: NodeStorageOps<NodeData = DotVertexData>> DotGraph<S>
impl<S: NodeStorageOps<NodeData = DotVertexData>> DotGraph<S>
pub fn compass_subgraph<Sub: ModifySubSet<Hedge> + SubSetLike>( &self, cps: Option<CompassPt>, ) -> Sub
pub fn write_io<W: Write>(&self, writer: &mut W) -> Result<(), Error>
pub fn write_fmt<W: Write>(&self, writer: &mut W) -> Result<(), Error>
pub fn from_file<'a, P>( p: P, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>
pub fn from_string<'a, Str: AsRef<str>>( s: Str, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>
pub fn from_string_with_figment<'a, Str: AsRef<str>>( s: Str, figment: Figment, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>
pub fn back_and_forth_dot(self) -> Self
pub fn debug_dot(&self) -> String
pub fn dot_of<Sub: SubGraphLike>(&self, subgraph: &Sub) -> String
pub fn format_dot( self, edge_format: impl AsRef<str>, vertex_format: impl AsRef<str>, ) -> String
Methods from Deref<Target = HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>>§
pub fn topo_sort_kahn(&self) -> Result<Vec<NodeIndex>, TopoError>
Sourcepub fn is_reachable(&self, source: NodeIndex, target: NodeIndex) -> bool
pub fn is_reachable(&self, source: NodeIndex, target: NodeIndex) -> bool
Checks if there is a path from source to target in the graph.
Uses breadth-first search to determine reachability. This method only follows source half-edges (outgoing edges) to traverse the directed graph structure.
§Arguments
source- The source nodetarget- The target node
§Returns
true if there is a directed path from source to target, false otherwise.
§Half-Edge Traversal
The algorithm only follows half-edges with Flow::Source to ensure
it respects the directed nature of edges in the graph.
pub fn check(&self) -> Result<(), HedgeGraphError>
Sourcepub fn delete_hedges<S: SubSetLike<Base = N::Base>>(&mut self, subgraph: &S)
pub fn delete_hedges<S: SubSetLike<Base = N::Base>>(&mut self, subgraph: &S)
Deletes all half-edges specified in the subgraph from the graph.
This operation modifies both the edge_store and node_store to remove
the specified half-edges and update connectivity information.
§Parameters
subgraph: A subgraph specifying the set of half-edges to delete.Smust implementSubGraphwithBase = N::Base.
Sourcepub fn concretize<'a, S: SubSetLike>(
&'a self,
subgraph: &'a S,
) -> HedgeGraph<&'a E, &'a V, &'a H, N::OpStorage<&'a V>>
pub fn concretize<'a, S: SubSetLike>( &'a self, subgraph: &'a S, ) -> HedgeGraph<&'a E, &'a V, &'a H, N::OpStorage<&'a V>>
Creates a new HedgeGraph instance representing a “concretized” view of a given subgraph.
This method effectively extracts the specified subgraph into a new, independent graph.
The new graph contains copies of the nodes and edges (and their data via references)
that are part of the subgraph.
Node and edge data in the new graph are references (&'a V, &'a E) to the data
in the original graph.
§Parameters
subgraph: A reference to a subgraphSwithin the current graph.
§Returns
A new HedgeGraph containing only the elements of the subgraph.
The node storage type of the new graph is N::OpStorage<&'a V>.
Sourcepub fn extract<O, V2, S: SubSetLike<Base = N::Base>>(
&mut self,
subgraph: &S,
split_edge_fn: impl FnMut(EdgeData<&E>) -> EdgeData<O>,
internal_data: impl FnMut(EdgeData<E>) -> EdgeData<O>,
split_node: impl FnMut(&V) -> V2,
owned_node: impl FnMut(V) -> V2,
) -> HedgeGraph<O, V2, H, N::OpStorage<V2>>
pub fn extract<O, V2, S: SubSetLike<Base = N::Base>>( &mut self, subgraph: &S, split_edge_fn: impl FnMut(EdgeData<&E>) -> EdgeData<O>, internal_data: impl FnMut(EdgeData<E>) -> EdgeData<O>, split_node: impl FnMut(&V) -> V2, owned_node: impl FnMut(V) -> V2, ) -> HedgeGraph<O, V2, H, N::OpStorage<V2>>
Extracts a subgraph and transforms its data, potentially splitting edges and nodes that are on the boundary of the subgraph.
This is a more advanced operation than concretize. It allows for:
- Transforming edge data for edges fully within the subgraph (
internal_dataclosure). - Transforming edge data for edges that are split by the subgraph boundary (
split_edge_fnclosure). - Transforming node data for nodes that are part of split edges (
split_nodeclosure). - Transforming node data for nodes fully within the subgraph and taking ownership (
owned_nodeclosure).
The result is a new HedgeGraph with transformed edge data O and node data V2.
§Parameters
subgraph: The subgraphSto extract.split_edge_fn: A closure that transformsEdgeData<&E>(for edges on the boundary) toEdgeData<O>.internal_data: A closure that transformsEdgeData<E>(for edges fully inside) toEdgeData<O>.split_node: A closure that transforms node data&V(for nodes on the boundary) toV2.owned_node: A closure that transforms node dataV(for nodes fully inside, taking ownership) toV2.
§Returns
A new HedgeGraph<O, V2, N::OpStorage<V2>> representing the extracted and transformed subgraph.
pub fn extract_nodes<O>(
&mut self,
nodes: impl IntoIterator<Item = NodeIndex>,
split_edge_fn: impl FnMut(EdgeData<&E>) -> EdgeData<O>,
internal_data: impl FnMut(EdgeData<E>) -> EdgeData<O>,
) -> HedgeGraph<O, V, H, N>where
N: NodeStorageOps<Base = SuBitGraph>,
Sourcepub fn inv(&self, hedge: Hedge) -> Hedge
pub fn inv(&self, hedge: Hedge) -> Hedge
Gives the involved hedge.
Returns the opposite (or “twin”) half-edge of the given hedge.
- If
hedgeis part of a paired edge, this returns its sibling half-edge. - If
hedgeis an identity (unpaired) half-edge, it returns itself.
§Parameters
hedge: The half-edge for which to find the opposite.
§Returns
The opposite Hedge.
Sourcepub fn split_edge(
&mut self,
hedge: Hedge,
data: EdgeData<E>,
) -> Result<(), HedgeGraphError>
pub fn split_edge( &mut self, hedge: Hedge, data: EdgeData<E>, ) -> Result<(), HedgeGraphError>
Splits a paired edge (identified by one of its half-edges, hedge) into two
new dangling (identity) half-edges.
The original edge data is typically associated with one of the new dangling edges,
and the provided data is associated with the other. The underlying Flow of the
new half-edges corresponds to their roles in the original paired edge.
§Parameters
hedge: One of the half-edges of the paired edge to be split.data: TheEdgeData<E>to be associated with the new dangling half-edge created from thehedgeside of the split. The original edge’s data will be associated with the other new dangling half-edge (created frominv(hedge)).
§Returns
Ok(())if the edge was successfully split.Err(HedgeGraphError::InvolutionError(InvolutionError::NotPaired))ifhedgeis an identity edge.
Sourcepub fn join_mut(
&mut self,
other: Self,
matching_fn: impl Fn(Flow, EdgeData<&E>, Flow, EdgeData<&E>) -> bool,
merge_fn: impl Fn(Flow, EdgeData<E>, Flow, EdgeData<E>) -> (Flow, EdgeData<E>),
) -> Result<(), HedgeGraphError>
pub fn join_mut( &mut self, other: Self, matching_fn: impl Fn(Flow, EdgeData<&E>, Flow, EdgeData<&E>) -> bool, merge_fn: impl Fn(Flow, EdgeData<E>, Flow, EdgeData<E>) -> (Flow, EdgeData<E>), ) -> Result<(), HedgeGraphError>
Joins another graph (other) into self by consuming other.
This is similar to join, but modifies self in place instead of returning a new graph.
Dangling edges are matched and merged according to matching_fn and merge_fn.
§Parameters
other: The graph to be consumed and joined intoself.matching_fn: A closure to determine if two dangling half-edges should match.merge_fn: A closure to determine the data for the newly formed paired edge.
§Returns
Ok(())if the join was successful.Err(HedgeGraphError)if an error occurs (e.g. fromself.edge_store.join_mutor if node validation fails).
Sourcepub fn sew(
&mut self,
matching_fn: impl Fn(Flow, EdgeData<&E>, Flow, EdgeData<&E>) -> bool,
merge_fn: impl Fn(Flow, EdgeData<E>, Flow, EdgeData<E>) -> (Flow, EdgeData<E>),
) -> Result<(), HedgeGraphError>
pub fn sew( &mut self, matching_fn: impl Fn(Flow, EdgeData<&E>, Flow, EdgeData<&E>) -> bool, merge_fn: impl Fn(Flow, EdgeData<E>, Flow, EdgeData<E>) -> (Flow, EdgeData<E>), ) -> Result<(), HedgeGraphError>
Sews dangling edges internal to the graph, matching edges with the given function and merging them with the given function.
“Sews” together pairs of dangling (identity) half-edges within the graph self.
This operation attempts to find pairs of dangling half-edges that satisfy matching_fn
and converts them into internal, paired edges. The data for the new paired edge
is determined by merge_fn.
§Parameters
matching_fn: A closure(Flow, EdgeData<&E>, Flow, EdgeData<&E>) -> boolthat determines if two dangling half-edges withinselfshould be matched.merge_fn: A closure(Flow, EdgeData<E>, Flow, EdgeData<E>) -> (Flow, EdgeData<E>)that provides the data for the new paired edge formed from two matched dangling edges.
§Returns
Ok(())if the sewing operation completes.Err(HedgeGraphError::InvolutionError)if an error occurs within the underlyingedge_store.sewoperation (e.g.InvolutionError::NotIdentityif an attempt is made to sew an edge that is not an identity edge).
Sourcepub fn is_connected<S: SubGraphLike>(&self, subgraph: &S) -> bool
pub fn is_connected<S: SubGraphLike>(&self, subgraph: &S) -> bool
Checks if the specified subgraph is connected.
A subgraph is connected if there is a path between any two half-edges (or nodes they are incident to) within that subgraph, using only edges also within the subgraph.
§Parameters
subgraph: The subgraphSto check for connectivity.
§Returns
true if the subgraph is connected, false otherwise.
Returns true for an empty subgraph.
§Panics
Panics if the traversal (used internally) fails, which can happen if the
starting node for traversal is not part of the subgraph.
Sourcepub fn cut_branches(&self, subgraph: &mut HedgeNode)
pub fn cut_branches(&self, subgraph: &mut HedgeNode)
Modifies a HedgeNode subgraph by removing “branches” or “tendrils”.
A branch is typically a path of edges within the subgraph that ultimately
connects to the rest of the subgraph at only one point (one node with degree > 1
within the branch, relative to other branch edges). This operation iteratively
removes edges that are part of such terminal paths until no more such branches exist.
It first removes purely external edges from the subgraph’s internal part,
then iteratively prunes edges that form degree-1 connections within the subgraph’s context.
Finally, it fixes the hairs of the HedgeNode to be consistent.
§Parameters
subgraph: A mutable reference to theHedgeNodeto be pruned.
Sourcepub fn internal_crown<S: SubSetLike>(&self, subgraph: &S) -> S::Base
pub fn internal_crown<S: SubSetLike>(&self, subgraph: &S) -> S::Base
Calculates the “internal crown” of a given subgraph.
The internal crown consists of all half-edges within the subgraph that are
either unpaired (dangling/external) or part of a “split” edge (i.e., their
opposite half-edge is not in the subgraph). These are effectively the
boundary half-edges of the subgraph from its own perspective.
§Parameters
subgraph: The subgraphSfor which to find the internal crown.
§Returns
A new subgraph of type S::Base containing the internal crown half-edges.
S::Base must implement ModifySubgraph<HedgePair>.
Sourcepub fn full_crown<S: SubSetLike>(&self, subgraph: &S) -> S::Base
pub fn full_crown<S: SubSetLike>(&self, subgraph: &S) -> S::Base
Calculates the “full crown” of a given subgraph.
The full crown consists of all half-edges that are incident to any node
touched by the subgraph, provided that these half-edges are either
unpaired (identity) or their opposite half-edge is also included in the subgraph.
This is different from internal_crown as it considers all incident edges to
nodes in the subgraph’s footprint, not just edges within the subgraph itself.
It might include edges not present in the initial subgraph.
§Parameters
subgraph: The subgraphSfor which to find the full crown.
§Returns
A new subgraph of type S::Base containing the full crown half-edges.
S::Base must implement ModifySubgraph<Hedge>.
Sourcepub fn external_filter<S: ModifySubSet<Hedge> + SubSetLike>(&self) -> S
pub fn external_filter<S: ModifySubSet<Hedge> + SubSetLike>(&self) -> S
Creates a SuBitGraph representing a subgraph containing all external (identity/dangling)
half-edges in the entire graph.
§Returns
A SuBitGraph where bits corresponding to external half-edges are set to true.
Sourcepub fn full_filter(&self) -> SuBitGraph
pub fn full_filter(&self) -> SuBitGraph
Creates a SuBitGraph representing a subgraph containing all half-edges in the graph.
§Returns
A SuBitGraph of length self.n_hedges() with all bits set to true.
Sourcepub fn full(&self) -> FullOrEmpty
pub fn full(&self) -> FullOrEmpty
Returns a FullOrEmpty subgraph representing the entire graph (all hedges included).
Sourcepub fn empty(&self) -> FullOrEmpty
pub fn empty(&self) -> FullOrEmpty
Returns a FullOrEmpty subgraph representing an empty graph (no hedges included).
Sourcepub fn clean_subgraph(&self, filter: SuBitGraph) -> InternalSubGraph
pub fn clean_subgraph(&self, filter: SuBitGraph) -> InternalSubGraph
Creates an InternalSubGraph from a SuBitGraph filter, ensuring it has no “hairs”.
This uses a “pessimistic” approach: an edge is included only if both its
half-edges are set in the input filter. Dangling edges are removed.
§Parameters
filter: ASuBitGraphrepresenting the desired set of half-edges.
§Returns
A new InternalSubGraph.
Sourcepub fn full_node(&self) -> HedgeNode
pub fn full_node(&self) -> HedgeNode
Returns a HedgeNode that represents the entire graph.
The internal_graph of this HedgeNode will include all internal edges,
and its hairs will include all external (dangling) edges of the graph.
Sourcepub fn full_graph(&self) -> InternalSubGraph
pub fn full_graph(&self) -> InternalSubGraph
Returns an InternalSubGraph that includes all fully internal edges of the graph.
External (dangling) edges are excluded.
Sourcepub fn empty_subgraph<S: SubSetLike>(&self) -> S
pub fn empty_subgraph<S: SubSetLike>(&self) -> S
Sourcepub fn from_filter<S: BaseSubgraph>(&self, filter: impl FnMut(&E) -> bool) -> S
pub fn from_filter<S: BaseSubgraph>(&self, filter: impl FnMut(&E) -> bool) -> S
Creates a subgraph of type S by filtering edges based on their data.
§Type Parameters
S: The type of subgraph to create, must implementBaseSubgraph.
§Parameters
filter: A closure that takes edge data&Eand returnstrueif the edge should be included in the subgraph.
§Returns
A new subgraph of type S.
Sourcepub fn nesting_node_from_subgraph(
&self,
internal_graph: InternalSubGraph,
) -> HedgeNode
pub fn nesting_node_from_subgraph( &self, internal_graph: InternalSubGraph, ) -> HedgeNode
Creates a HedgeNode from a given InternalSubGraph.
The internal_graph of the new HedgeNode is the one provided.
The hairs of the HedgeNode are calculated as all half-edges incident to the
internal_graph that are not part of the internal_graph itself.
§Parameters
internal_graph: TheInternalSubGraphto form the core of theHedgeNode.
§Panics
Panics if the provided internal_graph is not valid for this graph (e.g.,
if it refers to hedges outside the graph’s bounds or is not truly internal).
pub fn remove_internal_hedges(&self, subgraph: &SuBitGraph) -> SuBitGraph
Sourcepub fn count_internal_edges<S: SubSetLike>(&self, subgraph: &S) -> usize
pub fn count_internal_edges<S: SubSetLike>(&self, subgraph: &S) -> usize
Counts the number of full internal edges within the given subgraph.
An edge is considered internal if both its half-edges are included in the subgraph.
This method avoids double-counting by only counting an edge once.
§Parameters
subgraph: The subgraphSin which to count internal edges.
§Returns
The number of full internal edges.
pub fn n_edges(&self) -> usize
Sourcepub fn n_externals(&self) -> usize
pub fn n_externals(&self) -> usize
Returns the number of external (dangling/identity) half-edges in the graph.
Sourcepub fn n_internals(&self) -> usize
pub fn n_internals(&self) -> usize
Returns the number of internal (paired) half-edges in the graph. Note that this counts half-edges, so a single full internal edge contributes 2 to this count.
Sourcepub fn number_of_nodes_in_subgraph<S: SubSetLike>(&self, subgraph: &S) -> usize
pub fn number_of_nodes_in_subgraph<S: SubSetLike>(&self, subgraph: &S) -> usize
Sourcepub fn node_degrees_in_subgraph(
&self,
subgraph: &InternalSubGraph,
) -> AHashMap<NodeIndex, usize>
pub fn node_degrees_in_subgraph( &self, subgraph: &InternalSubGraph, ) -> AHashMap<NodeIndex, usize>
Calculates the degree of each node within the context of a given InternalSubGraph.
The degree of a node in this context is the number of half-edges from the subgraph
that are incident to that node.
§Parameters
subgraph: TheInternalSubGraphto calculate node degrees from.
§Returns
An AHashMap mapping each NodeIndex (for nodes involved in the subgraph)
to its degree within that subgraph.
Sourcepub fn owned_neighbors<S: SubGraphLike>(
&self,
subgraph: &S,
pos: Hedge,
) -> SuBitGraph
pub fn owned_neighbors<S: SubGraphLike>( &self, subgraph: &S, pos: Hedge, ) -> SuBitGraph
including pos
pub fn connected_neighbors<S: SubGraphLike>( &self, subgraph: &S, pos: Hedge, ) -> Option<SuBitGraph>
pub fn get_edge_data(&self, edge: Hedge) -> &E
pub fn hedge_pair(&self, hedge: Hedge) -> HedgePair
pub fn get_edge_data_full(&self, hedge: Hedge) -> EdgeData<&E>
pub fn superficial_hedge_orientation(&self, hedge: Hedge) -> Option<Flow>
pub fn underlying_hedge_orientation(&self, hedge: Hedge) -> Flow
pub fn neighbors(&self, hedge: Hedge) -> N::NeighborsIter<'_>
pub fn iter_crown(&self, id: NodeIndex) -> N::NeighborsIter<'_>
pub fn sub_iter_crown<'a, S: SubSetLike>( &'a self, id: NodeIndex, subgraph: &'a S, ) -> impl Iterator<Item = Hedge> + 'a
pub fn id_from_crown<'a>( &'a self, neighbors: N::NeighborsIter<'a>, ) -> Option<NodeIndex>
pub fn involved_node_crown(&self, hedge: Hedge) -> Option<N::NeighborsIter<'_>>
pub fn involved_node_id(&self, hedge: Hedge) -> Option<NodeIndex>
pub fn node_id(&self, hedge: Hedge) -> NodeIndex
pub fn is_self_loop(&self, hedge: Hedge) -> bool
pub fn is_dangling(&self, hedge: Hedge) -> bool
Sourcepub fn nodes<S: SubSetLike>(&self, subgraph: &S) -> Vec<NodeIndex>
pub fn nodes<S: SubSetLike>(&self, subgraph: &S) -> Vec<NodeIndex>
Collect all nodes in the subgraph (all nodes that the hedges are connected to)
pub fn set_flow(&mut self, hedge: Hedge, flow: Flow)
Sourcepub fn forget_identification_history(&mut self) -> NodeVec<V>
pub fn forget_identification_history(&mut self) -> NodeVec<V>
Permutes nodes not pointing to any root anymore to end of nodestore and then extract it
Sourcepub fn identify_nodes(
&mut self,
nodes: &[NodeIndex],
node_data_merge: V,
) -> NodeIndex
pub fn identify_nodes( &mut self, nodes: &[NodeIndex], node_data_merge: V, ) -> NodeIndex
Retains the NodeIndex ordering and just appends a new node.
Sourcepub fn contract_subgraph<S: SubSetLike<Base = N::Base>>(
&mut self,
subgraph: &S,
node_data_merge: V,
)
pub fn contract_subgraph<S: SubSetLike<Base = N::Base>>( &mut self, subgraph: &S, node_data_merge: V, )
Identifies all nodes in this subgraph and gives value node_data_merge to identified node. Deletes all edges in the subgraph. This invalidates both hedge indices and node indices
Sourcepub fn identify_nodes_without_self_edges<S>(
&mut self,
nodes: &[NodeIndex],
node_data_merge: V,
) -> (NodeIndex, S)
pub fn identify_nodes_without_self_edges<S>( &mut self, nodes: &[NodeIndex], node_data_merge: V, ) -> (NodeIndex, S)
Retains the NodeIndex ordering and just appends a new node.
Sourcepub fn edges<S: SubSetLike>(&self, subgraph: &S) -> Vec<EdgeIndex>
pub fn edges<S: SubSetLike>(&self, subgraph: &S) -> Vec<EdgeIndex>
Collect all edges in the subgraph
(This is without double counting, i.e. if two half-edges are part of the same edge, only one EdgeIndex will be collected)
pub fn map_data_ref<'a, E2, V2, H2>( &'a self, node_map: impl FnMut(&'a Self, N::NeighborsIter<'a>, &'a V) -> V2, edge_map: impl FnMut(&'a Self, EdgeIndex, HedgePair, EdgeData<&'a E>) -> EdgeData<E2>, hedge_map: impl FnMut(Hedge, &'a H) -> H2, ) -> HedgeGraph<E2, V2, H2, N::OpStorage<V2>>
pub fn to_ref(&self) -> HedgeGraph<&E, &V, &H, N::OpStorage<&V>>
pub fn map_data_ref_mut<'a, E2, V2, H2>( &'a mut self, node_map: impl FnMut(N::NeighborsIter<'a>, &'a mut V) -> V2, edge_map: impl FnMut(EdgeIndex, HedgePair, EdgeData<&'a mut E>) -> EdgeData<E2>, hedge_map: impl FnMut((Hedge, &'a H)) -> H2, ) -> HedgeGraph<E2, V2, H2, N::OpStorage<V2>>
pub fn map_data_ref_result<'a, E2, V2, H2, Er>( &'a self, node_map: impl FnMut(&'a Self, N::NeighborsIter<'a>, &'a V) -> Result<V2, Er>, edge_map: impl FnMut(&'a Self, EdgeIndex, HedgePair, EdgeData<&'a E>) -> Result<EdgeData<E2>, Er>, hedge_map: impl FnMut((Hedge, &'a H)) -> Result<H2, Er>, ) -> Result<HedgeGraph<E2, V2, H2, N::OpStorage<V2>>, Er>
pub fn just_structure(&self) -> HedgeGraph<(), (), (), N::OpStorage<()>>
pub fn map_nodes_ref<'a, V2>( &'a self, f: impl FnMut(&'a Self, N::NeighborsIter<'a>, &'a V) -> V2, ) -> HedgeGraph<&'a E, V2, &'a H, N::OpStorage<V2>>
pub fn new_smart_hedgevec<T>( &self, f: &impl Fn(HedgePair, EdgeData<&E>) -> EdgeData<T>, ) -> SmartEdgeVec<T>
pub fn new_edgevec<T>( &self, f: impl FnMut(&E, EdgeIndex, &HedgePair) -> T, ) -> EdgeVec<T>
pub fn new_nodevec<'a, T>( &'a self, f: impl FnMut(NodeIndex, N::NeighborsIter<'a>, &'a V) -> T, ) -> NodeVec<T>
pub fn new_hedgevec<T>(&self, f: impl FnMut(Hedge, &H) -> T) -> HedgeVec<T>
pub fn new_edgevec_from_iter<T, I: IntoIterator<Item = T>>( &self, iter: I, ) -> Result<EdgeVec<T>, HedgeGraphError>
Sourcepub fn non_cut_edges(&self) -> AHashSet<SuBitGraph>
pub fn non_cut_edges(&self) -> AHashSet<SuBitGraph>
all sets of full edges that do not disconnect the graph/ increase its connected components
pub fn non_bridges(&self) -> SuBitGraph
pub fn non_bridges_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> SuBitGraph
pub fn bridges_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> SuBitGraph
pub fn bridges(&self) -> SuBitGraph
pub fn combine_to_single_hedgenode(&self, source: &[NodeIndex]) -> HedgeNode
pub fn all_cuts_from_ids(
&self,
source: &[NodeIndex],
target: &[NodeIndex],
) -> Vec<(SuBitGraph, OrientedCut, SuBitGraph)>where
N: NodeStorageOps,
pub fn tadpoles(&self, externals: &[NodeIndex]) -> Vec<SuBitGraph> ⓘ
pub fn all_cuts(
&self,
source: HedgeNode,
target: HedgeNode,
) -> Vec<(SuBitGraph, OrientedCut, SuBitGraph)>where
N: NodeStorageOps,
pub fn all_s_t_cuts_impl<S: SubSetLike<Base = SuBitGraph>>( &self, subgraph: &S, s_connectivity: usize, s: HedgeNode, t: &HedgeNode, t_connectivity: usize, regions: &mut AHashSet<HedgeNode>, )
Sourcepub fn all_spanning_forests_of<S: SubGraphLike>(
&self,
subgraph: &S,
) -> Vec<S::Base>where
for<'a> N::OpStorage<&'a V>: Clone,
S::Base: SubSetLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,
pub fn all_spanning_forests_of<S: SubGraphLike>(
&self,
subgraph: &S,
) -> Vec<S::Base>where
for<'a> N::OpStorage<&'a V>: Clone,
S::Base: SubSetLike<Base = S::Base> + SubSetOps + Clone + ModifySubSet<HedgePair> + ModifySubSet<Hedge>,
Gives all subgraphs corresponding to all the spanning trees of the graph Winter, Pawel. “An Algorithm for the Enumeration of Spanning Trees.” BIT Numerical Mathematics 26, no. 1 (March 1, 1986): 44–62. https://doi.org/10.1007/BF01939361.
pub fn cyclotomatic_number<S: SubGraphLike>(&self, subgraph: &S) -> usize
pub fn cycle_basis(&self) -> (Vec<Cycle>, SimpleTraversalTree)
pub fn cycle_basis_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> (Vec<Cycle>, SimpleTraversalTree)
pub fn order_basis(&self, basis: &[HedgeNode]) -> Vec<Vec<InternalSubGraph>>
pub fn all_cycles(&self) -> Vec<Cycle>
pub fn all_cycle_sym_diffs( &self, ) -> Result<Vec<InternalSubGraph>, TryFromIntError>
pub fn all_cycle_unions(&self) -> AHashSet<InternalSubGraph>
pub fn paton_count_loops( &self, subgraph: &InternalSubGraph, start: &NodeIndex, ) -> Result<usize, HedgeGraphError>
pub fn paton_cycle_basis<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, start: &NodeIndex, included_hedge: Option<Hedge>, ) -> Result<(Vec<Cycle>, SimpleTraversalTree), HedgeGraphError>
pub fn all_spinneys_with_basis( &self, basis: &[&InternalSubGraph], ) -> AHashSet<HedgeNode>
pub fn all_spinneys_rec( &self, spinneys: &mut AHashSet<HedgeNode>, cycle_sums: Vec<HedgeNode>, )
pub fn all_spinneys( &self, ) -> AHashMap<InternalSubGraph, Vec<(InternalSubGraph, Option<InternalSubGraph>)>>
pub fn all_spinneys_alt(&self) -> AHashSet<InternalSubGraph>
pub fn count_connected_components<S: SubGraphLike>(&self, subgraph: &S) -> usize
pub fn connected_components<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<SuBitGraph> ⓘ
pub fn align_underlying_to_superficial(&mut self)
Sourcepub fn align_underlying_to_tree<P: ForestNodeStore<NodeData = ()>>(
&mut self,
tree: &SimpleTraversalTree<P>,
)
pub fn align_underlying_to_tree<P: ForestNodeStore<NodeData = ()>>( &mut self, tree: &SimpleTraversalTree<P>, )
aligns the underlying orientation of the graph to the tree, such that all tree edges are oriented towards the root, and all others point towards the leaves
Relies on the tree being tremaux (i.e. the tree-order is total) This is the case for depth-first traversal.
Sourcepub fn align_superficial_to_tree<P: ForestNodeStore<NodeData = ()>>(
&mut self,
tree: &SimpleTraversalTree<P>,
)
pub fn align_superficial_to_tree<P: ForestNodeStore<NodeData = ()>>( &mut self, tree: &SimpleTraversalTree<P>, )
aligns the superficial orientation of the graph to the tree,
such that all tree edges are oriented towards the root, and all others are unoriented.
pub fn iter_hedges(&self) -> impl Iterator<Item = (Hedge, &H)>
Sourcepub fn iter_nodes(
&self,
) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'_>, &V)>
pub fn iter_nodes( &self, ) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'_>, &V)>
Iterate over all nodes, returns an iterator that yields
pub fn iter_nodes_mut( &mut self, ) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'_>, &mut V)>
pub fn iter_node_ids(&self) -> impl Iterator<Item = NodeIndex> + '_
pub fn iter_edge_ids_of<'a, S: SubSetLike>( &'a self, subgraph: &'a S, ) -> EdgeIter<'a, E, V, H, S, N, S::BaseIter<'a>>
pub fn iter_edges_of<'a, S: SubSetLike>( &'a self, subgraph: &'a S, ) -> impl Iterator<Item = (HedgePair, EdgeIndex, EdgeData<&'a E>)> + 'a
pub fn iter_edges( &self, ) -> impl Iterator<Item = (HedgePair, EdgeIndex, EdgeData<&E>)>
pub fn iter_nodes_of<'a, S: SubSetLike>(
&'a self,
subgraph: &'a S,
) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'a>, &'a V)>where
N::NeighborsIter<'a>: Clone,
pub fn dot_impl_fmt<S: SubGraphLike, Str1: AsRef<str>>( &self, writer: &mut impl Write, subgraph: &S, graph_info: Str1, hedge_attr: &impl Fn(&H) -> Option<String>, edge_attr: &impl Fn(&E) -> Option<String>, node_attr: &impl Fn(&V) -> Option<String>, ) -> Result<(), Error>
pub fn dot_impl_io<S: SubGraphLike, Str1: AsRef<str>>( &self, writer: &mut impl Write, subgraph: &S, graph_info: Str1, hedge_attr: &impl Fn(&H) -> Option<String>, edge_attr: &impl Fn(&E) -> Option<String>, node_attr: &impl Fn(&V) -> Option<String>, ) -> Result<(), Error>
pub fn dot_impl<S: SubGraphLike, Str1: AsRef<str>>( &self, subgraph: &S, graph_info: Str1, hedge_attr: &impl Fn(&H) -> Option<String>, edge_attr: &impl Fn(&E) -> Option<String>, node_attr: &impl Fn(&V) -> Option<String>, ) -> String
pub fn dot<S: SubGraphLike>(&self, node_as_graph: &S) -> String
pub fn dot_display<S: SubGraphLike>(&self, node_as_graph: &S) -> String
pub fn dot_label<S: SubGraphLike>(&self, node_as_graph: &S) -> String
pub fn base_dot(&self) -> String
pub fn dot_serialize_of<S: SubGraphLike>( &self, subgraph: &S, global: impl Into<GlobalData>, hedge_map: &impl Fn(&H) -> DotHedgeData, edge_map: &impl Fn(&E) -> DotEdgeData, node_map: &impl Fn(&V) -> DotVertexData, ) -> String
pub fn dot_serialize_io( &self, writer: &mut impl Write, global: impl Into<GlobalData>, hedge_map: &impl Fn(&H) -> DotHedgeData, edge_map: &impl Fn(&E) -> DotEdgeData, node_map: &impl Fn(&V) -> DotVertexData, ) -> Result<(), Error>
pub fn dot_serialize_fmt( &self, writer: &mut impl Write, global: impl Into<GlobalData>, hedge_map: &impl Fn(&H) -> DotHedgeData, edge_map: &impl Fn(&E) -> DotEdgeData, node_map: &impl Fn(&V) -> DotVertexData, ) -> Result<(), Error>
Trait Implementations§
Source§impl<N: Clone + NodeStorage<NodeData = DotVertexData>> Clone for DotGraph<N>
impl<N: Clone + NodeStorage<NodeData = DotVertexData>> Clone for DotGraph<N>
Source§impl<N: Debug + NodeStorage<NodeData = DotVertexData>> Debug for DotGraph<N>
impl<N: Debug + NodeStorage<NodeData = DotVertexData>> Debug for DotGraph<N>
Source§impl<N: NodeStorage<NodeData = DotVertexData>> Deref for DotGraph<N>
impl<N: NodeStorage<NodeData = DotVertexData>> Deref for DotGraph<N>
Source§type Target = HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>
type Target = HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>
Source§impl<N: NodeStorage<NodeData = DotVertexData>> DerefMut for DotGraph<N>
impl<N: NodeStorage<NodeData = DotVertexData>> DerefMut for DotGraph<N>
impl<N: Eq + NodeStorage<NodeData = DotVertexData>> Eq for DotGraph<N>
Source§impl<S: NodeStorageOps<NodeData = DotVertexData>> From<(SubGraphFreeGraph, Figment)> for DotGraph<S>
impl<S: NodeStorageOps<NodeData = DotVertexData>> From<(SubGraphFreeGraph, Figment)> for DotGraph<S>
Source§impl<N: PartialEq + NodeStorage<NodeData = DotVertexData>> PartialEq for DotGraph<N>
impl<N: PartialEq + NodeStorage<NodeData = DotVertexData>> PartialEq for DotGraph<N>
impl<N: PartialEq + NodeStorage<NodeData = DotVertexData>> StructuralPartialEq for DotGraph<N>
Auto Trait Implementations§
impl<N> Freeze for DotGraph<N>where
N: Freeze,
impl<N> RefUnwindSafe for DotGraph<N>where
N: RefUnwindSafe,
impl<N> Send for DotGraph<N>where
N: Send,
impl<N> Sync for DotGraph<N>where
N: Sync,
impl<N> Unpin for DotGraph<N>where
N: Unpin,
impl<N> UnsafeUnpin for DotGraph<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for DotGraph<N>where
N: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.