Skip to main content

DotGraph

Struct DotGraph 

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

Source

pub fn compass_subgraph<Sub: ModifySubSet<Hedge> + SubSetLike>( &self, cps: Option<CompassPt>, ) -> Sub

Source

pub fn write_io<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source

pub fn write_fmt<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source

pub fn from_file<'a, P>( p: P, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>
where P: AsRef<Path>,

Source

pub fn from_string<'a, Str: AsRef<str>>( s: Str, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>

Source

pub fn from_string_with_figment<'a, Str: AsRef<str>>( s: Str, figment: Figment, ) -> Result<Self, HedgeParseError<'a, (), (), (), ()>>

Source

pub fn back_and_forth_dot(self) -> Self

Source

pub fn debug_dot(&self) -> String

Source

pub fn dot_of<Sub: SubGraphLike>(&self, subgraph: &Sub) -> String

Source

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

Source

pub fn topo_sort_kahn(&self) -> Result<Vec<NodeIndex>, TopoError>

Source

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 node
  • target - 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.

Source

pub fn check(&self) -> Result<(), HedgeGraphError>

Source

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. S must implement SubGraph with Base = N::Base.
Source

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 subgraph S within 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>.

Source

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_data closure).
  • Transforming edge data for edges that are split by the subgraph boundary (split_edge_fn closure).
  • Transforming node data for nodes that are part of split edges (split_node closure).
  • Transforming node data for nodes fully within the subgraph and taking ownership (owned_node closure).

The result is a new HedgeGraph with transformed edge data O and node data V2.

§Parameters
  • subgraph: The subgraph S to extract.
  • split_edge_fn: A closure that transforms EdgeData<&E> (for edges on the boundary) to EdgeData<O>.
  • internal_data: A closure that transforms EdgeData<E> (for edges fully inside) to EdgeData<O>.
  • split_node: A closure that transforms node data &V (for nodes on the boundary) to V2.
  • owned_node: A closure that transforms node data V (for nodes fully inside, taking ownership) to V2.
§Returns

A new HedgeGraph<O, V2, N::OpStorage<V2>> representing the extracted and transformed subgraph.

Source

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

Source

pub fn inv(&self, hedge: Hedge) -> Hedge

Gives the involved hedge. Returns the opposite (or “twin”) half-edge of the given hedge.

  • If hedge is part of a paired edge, this returns its sibling half-edge.
  • If hedge is an identity (unpaired) half-edge, it returns itself.
§Parameters
  • hedge: The half-edge for which to find the opposite.
§Returns

The opposite Hedge.

Source

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: The EdgeData<E> to be associated with the new dangling half-edge created from the hedge side of the split. The original edge’s data will be associated with the other new dangling half-edge (created from inv(hedge)).
§Returns
  • Ok(()) if the edge was successfully split.
  • Err(HedgeGraphError::InvolutionError(InvolutionError::NotPaired)) if hedge is an identity edge.
Source

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 into self.
  • 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. from self.edge_store.join_mut or if node validation fails).
Source

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>) -> bool that determines if two dangling half-edges within self should 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 underlying edge_store.sew operation (e.g. InvolutionError::NotIdentity if an attempt is made to sew an edge that is not an identity edge).
Source

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 subgraph S to 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.

Source

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 the HedgeNode to be pruned.
Source

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 subgraph S for 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>.

Source

pub fn full_crown<S: SubSetLike>(&self, subgraph: &S) -> S::Base
where S::Base: ModifySubSet<Hedge>,

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 subgraph S for 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>.

Source

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.

Source

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.

Source

pub fn full(&self) -> FullOrEmpty

Returns a FullOrEmpty subgraph representing the entire graph (all hedges included).

Source

pub fn empty(&self) -> FullOrEmpty

Returns a FullOrEmpty subgraph representing an empty graph (no hedges included).

Source

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: A SuBitGraph representing the desired set of half-edges.
§Returns

A new InternalSubGraph.

Source

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.

Source

pub fn full_graph(&self) -> InternalSubGraph

Returns an InternalSubGraph that includes all fully internal edges of the graph. External (dangling) edges are excluded.

Source

pub fn empty_subgraph<S: SubSetLike>(&self) -> S

Creates an empty subgraph of a specific type S.

§Type Parameters
  • S: The type of subgraph to create, must implement SubGraph.
§Returns

A new, empty subgraph of type S, sized for this graph.

Source

pub fn from_filter<S: BaseSubgraph>(&self, filter: impl FnMut(&E) -> bool) -> S
where S::Base: SubSetOps<Hedge>,

Creates a subgraph of type S by filtering edges based on their data.

§Type Parameters
  • S: The type of subgraph to create, must implement BaseSubgraph.
§Parameters
  • filter: A closure that takes edge data &E and returns true if the edge should be included in the subgraph.
§Returns

A new subgraph of type S.

Source

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: The InternalSubGraph to form the core of the HedgeNode.
§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).

Source

pub fn remove_internal_hedges(&self, subgraph: &SuBitGraph) -> SuBitGraph

Source

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 subgraph S in which to count internal edges.
§Returns

The number of full internal edges.

Source

pub fn n_hedges(&self) -> usize

Returns the total number of half-edges in the graph.

Source

pub fn n_edges(&self) -> usize

Source

pub fn n_nodes(&self) -> usize

Returns the total number of nodes in the graph.

Source

pub fn n_externals(&self) -> usize

Returns the number of external (dangling/identity) half-edges in the graph.

Source

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.

Source

pub fn number_of_nodes_in_subgraph<S: SubSetLike>(&self, subgraph: &S) -> usize

Counts the number of distinct nodes that are incident to at least one half-edge in the given subgraph.

§Parameters
  • subgraph: The subgraph S to consider.
§Returns

The number of unique nodes touched by the subgraph.

Source

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: The InternalSubGraph to calculate node degrees from.
§Returns

An AHashMap mapping each NodeIndex (for nodes involved in the subgraph) to its degree within that subgraph.

Source

pub fn owned_neighbors<S: SubGraphLike>( &self, subgraph: &S, pos: Hedge, ) -> SuBitGraph

including pos

Source

pub fn connected_neighbors<S: SubGraphLike>( &self, subgraph: &S, pos: Hedge, ) -> Option<SuBitGraph>

Source

pub fn get_edge_data(&self, edge: Hedge) -> &E

Source

pub fn hedge_pair(&self, hedge: Hedge) -> HedgePair

Source

pub fn get_edge_data_full(&self, hedge: Hedge) -> EdgeData<&E>

Source

pub fn flow(&self, hedge: Hedge) -> Flow

Gives the underlying orientation of this half-edge.

Source

pub fn superficial_hedge_orientation(&self, hedge: Hedge) -> Option<Flow>

Source

pub fn underlying_hedge_orientation(&self, hedge: Hedge) -> Flow

Source

pub fn neighbors(&self, hedge: Hedge) -> N::NeighborsIter<'_>

Source

pub fn iter_crown(&self, id: NodeIndex) -> N::NeighborsIter<'_>

Source

pub fn sub_iter_crown<'a, S: SubSetLike>( &'a self, id: NodeIndex, subgraph: &'a S, ) -> impl Iterator<Item = Hedge> + 'a

Source

pub fn id_from_crown<'a>( &'a self, neighbors: N::NeighborsIter<'a>, ) -> Option<NodeIndex>

Source

pub fn involved_node_crown(&self, hedge: Hedge) -> Option<N::NeighborsIter<'_>>

Source

pub fn involved_node_id(&self, hedge: Hedge) -> Option<NodeIndex>

Source

pub fn node_id(&self, hedge: Hedge) -> NodeIndex

Source

pub fn is_self_loop(&self, hedge: Hedge) -> bool

Source

pub fn is_dangling(&self, hedge: Hedge) -> bool

Source

pub fn nodes<S: SubSetLike>(&self, subgraph: &S) -> Vec<NodeIndex>

Collect all nodes in the subgraph (all nodes that the hedges are connected to)

Source

pub fn set_flow(&mut self, hedge: Hedge, flow: Flow)

Source

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

Source

pub fn identify_nodes( &mut self, nodes: &[NodeIndex], node_data_merge: V, ) -> NodeIndex

Retains the NodeIndex ordering and just appends a new node.

Source

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

Source

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.

Source

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)

Source

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

Source

pub fn to_ref(&self) -> HedgeGraph<&E, &V, &H, N::OpStorage<&V>>

Source

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

Source

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>

Source

pub fn just_structure(&self) -> HedgeGraph<(), (), (), N::OpStorage<()>>

Source

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

Source

pub fn new_smart_hedgevec<T>( &self, f: &impl Fn(HedgePair, EdgeData<&E>) -> EdgeData<T>, ) -> SmartEdgeVec<T>

Source

pub fn new_edgevec<T>( &self, f: impl FnMut(&E, EdgeIndex, &HedgePair) -> T, ) -> EdgeVec<T>

Source

pub fn new_nodevec<'a, T>( &'a self, f: impl FnMut(NodeIndex, N::NeighborsIter<'a>, &'a V) -> T, ) -> NodeVec<T>

Source

pub fn new_hedgevec<T>(&self, f: impl FnMut(Hedge, &H) -> T) -> HedgeVec<T>

Source

pub fn new_edgevec_from_iter<T, I: IntoIterator<Item = T>>( &self, iter: I, ) -> Result<EdgeVec<T>, HedgeGraphError>

Source

pub fn non_cut_edges(&self) -> AHashSet<SuBitGraph>

all sets of full edges that do not disconnect the graph/ increase its connected components

Source

pub fn non_bridges(&self) -> SuBitGraph

Source

pub fn non_bridges_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> SuBitGraph

Source

pub fn bridges_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> SuBitGraph

Source

pub fn bridges(&self) -> SuBitGraph

Source

pub fn combine_to_single_hedgenode(&self, source: &[NodeIndex]) -> HedgeNode

Source

pub fn all_cuts_from_ids( &self, source: &[NodeIndex], target: &[NodeIndex], ) -> Vec<(SuBitGraph, OrientedCut, SuBitGraph)>
where N: NodeStorageOps,

Source

pub fn tadpoles(&self, externals: &[NodeIndex]) -> Vec<SuBitGraph>

Source

pub fn all_cuts( &self, source: HedgeNode, target: HedgeNode, ) -> Vec<(SuBitGraph, OrientedCut, SuBitGraph)>
where N: NodeStorageOps,

Source

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

Source

pub fn all_spanning_forests_of<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<S::Base>

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.

Source

pub fn cyclotomatic_number<S: SubGraphLike>(&self, subgraph: &S) -> usize

Source

pub fn cycle_basis(&self) -> (Vec<Cycle>, SimpleTraversalTree)

Source

pub fn cycle_basis_of<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, ) -> (Vec<Cycle>, SimpleTraversalTree)

Source

pub fn order_basis(&self, basis: &[HedgeNode]) -> Vec<Vec<InternalSubGraph>>

Source

pub fn all_cycles(&self) -> Vec<Cycle>

Source

pub fn all_cycle_sym_diffs( &self, ) -> Result<Vec<InternalSubGraph>, TryFromIntError>

Source

pub fn all_cycle_unions(&self) -> AHashSet<InternalSubGraph>

Source

pub fn paton_count_loops( &self, subgraph: &InternalSubGraph, start: &NodeIndex, ) -> Result<usize, HedgeGraphError>

Source

pub fn paton_cycle_basis<S: SubSetLike<Base = SuBitGraph> + SubGraphLike>( &self, subgraph: &S, start: &NodeIndex, included_hedge: Option<Hedge>, ) -> Result<(Vec<Cycle>, SimpleTraversalTree), HedgeGraphError>

Source

pub fn all_spinneys_with_basis( &self, basis: &[&InternalSubGraph], ) -> AHashSet<HedgeNode>

Source

pub fn all_spinneys_rec( &self, spinneys: &mut AHashSet<HedgeNode>, cycle_sums: Vec<HedgeNode>, )

Source

pub fn all_spinneys( &self, ) -> AHashMap<InternalSubGraph, Vec<(InternalSubGraph, Option<InternalSubGraph>)>>

Source

pub fn all_spinneys_alt(&self) -> AHashSet<InternalSubGraph>

Source

pub fn count_connected_components<S: SubGraphLike>(&self, subgraph: &S) -> usize

Source

pub fn connected_components<S: SubGraphLike>( &self, subgraph: &S, ) -> Vec<SuBitGraph>

Source

pub fn align_underlying_to_superficial(&mut self)

Source

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.

Source

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.

Source

pub fn iter_hedges(&self) -> impl Iterator<Item = (Hedge, &H)>

Source

pub fn iter_nodes( &self, ) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'_>, &V)>

Iterate over all nodes, returns an iterator that yields

Source

pub fn iter_nodes_mut( &mut self, ) -> impl Iterator<Item = (NodeIndex, N::NeighborsIter<'_>, &mut V)>

Source

pub fn iter_node_ids(&self) -> impl Iterator<Item = NodeIndex> + '_

Source

pub fn iter_edge_ids_of<'a, S: SubSetLike>( &'a self, subgraph: &'a S, ) -> EdgeIter<'a, E, V, H, S, N, S::BaseIter<'a>>

Source

pub fn iter_edges_of<'a, S: SubSetLike>( &'a self, subgraph: &'a S, ) -> impl Iterator<Item = (HedgePair, EdgeIndex, EdgeData<&'a E>)> + 'a

Source

pub fn iter_edges( &self, ) -> impl Iterator<Item = (HedgePair, EdgeIndex, EdgeData<&E>)>

Source

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,

Source

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>

Source

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>

Source

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

Source

pub fn dot<S: SubGraphLike>(&self, node_as_graph: &S) -> String

Source

pub fn dot_display<S: SubGraphLike>(&self, node_as_graph: &S) -> String
where E: Display, V: Display, H: Display,

Source

pub fn dot_label<S: SubGraphLike>(&self, node_as_graph: &S) -> String
where E: Display, V: Display,

Source

pub fn base_dot(&self) -> String

Source

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

Source

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>

Source

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>

Source§

fn clone(&self) -> DotGraph<N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: Debug + NodeStorage<NodeData = DotVertexData>> Debug for DotGraph<N>

Source§

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

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

impl<N: NodeStorage<NodeData = DotVertexData>> Deref for DotGraph<N>

Source§

type Target = HedgeGraph<DotEdgeData, DotVertexData, DotHedgeData, N>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<N: NodeStorage<NodeData = DotVertexData>> DerefMut for DotGraph<N>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<N: Eq + NodeStorage<NodeData = DotVertexData>> Eq for DotGraph<N>

Source§

impl<S: NodeStorageOps<NodeData = DotVertexData>> From<(SubGraphFreeGraph, Figment)> for DotGraph<S>

Source§

fn from((value, fig): (SubGraphFreeGraph, Figment)) -> Self

Converts to this type from the input type.
Source§

impl<N: PartialEq + NodeStorage<NodeData = DotVertexData>> PartialEq for DotGraph<N>

Source§

fn eq(&self, other: &DotGraph<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
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