Skip to main content

SteinerTreeExt

Trait SteinerTreeExt 

Source
pub trait SteinerTreeExt: Graph {
    // Provided method
    fn steiner_tree(&self) -> SteinerTreeBuilder<'_, Self>
       where Self: Sized { ... }
}

Provided Methods§

Source

fn steiner_tree(&self) -> SteinerTreeBuilder<'_, Self>
where Self: Sized,

Examples found in repository?
crates/library_checker/src/graph/minimum_steiner_tree.rs (line 10)
5pub fn minimum_steiner_tree(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(n, m, (graph, weights): @UndirectedGraphScanner::<usize, u64>::new(n, m));
8    sc!(k, terminals: [usize; k]);
9    let tree = graph
10        .steiner_tree()
11        .with_standard_sp_additive()
12        .with_parent()
13        .solve(terminals[1..].iter().copied(), |eid| weights[eid]);
14    let edges = tree.edges_from_source(terminals[0]).unwrap();
15    pp!(tree.minimum_from_source(terminals[0]), edges.len(); @it edges);
16}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<G> SteinerTreeExt for G
where G: Graph + ?Sized,