fn detect_and_compute_cycle(
    &self,
    src_id: EntryId,
    dst_id: EntryId,
    should_include_edge: impl Fn(EdgeId) -> bool,
  ) -> Option<Vec<N>> {
    if !self.detect_cycle(src_id, dst_id, &should_include_edge) {
      return None;
    }

    Self::shortest_path(&self.pg, dst_id, src_id, should_include_edge).map(|mut path| {
      path.reverse();
      path.push(dst_id);
      path
        .into_iter()
        .map(|node_index| self.unsafe_entry_for_id(node_index).node().clone())
        .collect()
    })
  }
///
/// Detect whether adding an edge from src to dst would create a cycle and returns a path which
/// would represent the cycle if an edge were added from src to dst. Returns None if no cycle
/// would be created.
///
/// This is a very expensive method relative to `detect_cycle`: if you don't need the cyclic
/// path, prefer to call `detect_cycle`.
///
Detect whether adding an edge from src to dst would create a cycle and returns a path which
would represent the cycle if an edge were added from src to dst. Returns None if no cycle
would be created.

This is a very expensive method relative to `detect_cycle`: if you don't need the cyclic
path, prefer to call `detect_cycle`.
Detect whether adding an edge from src to dst would create a cycle and returns a path which would represent the cycle if an edge were added from src to dst . Returns None if no cycle would be created . This is a very expensive method relative to ` detect_cycle ` : if you don ' t need the cyclic path prefer to call ` detect_cycle ` .
fn detect_and_compute_cycle(
    &self,
    src_id: EntryId,
    dst_id: EntryId,
    should_include_edge: impl Fn(EdgeId) -> bool,
  ) -> Option<Vec<N>> {
    if !self.detect_cycle(src_id, dst_id, &should_include_edge) {
      return None;
    }
    Self::shortest_path(&self.pg, dst_id, src_id, should_include_edge).map(|mut path| {
      path.reverse();
      path.push(dst_id);
      path
        .into_iter()
        .map(|node_index| self.unsafe_entry_for_id(node_index).node().clone())
        .collect()
    })
  }
fn detect_and_compute_cycle ( & self , src_id : EntryId , dst_id : EntryId , should_include_edge : impl Fn ( EdgeId ) -> bool , ) -> Option < Vec < N > > { if ! self . detect_cycle ( src_id , dst_id , & should_include_edge ) { return None ; } Self :: shortest_path ( & self . pg , dst_id , src_id , should_include_edge ) . map ( | mut path | { path . reverse ( ) ; path . push ( dst_id ) ; path . into_iter ( ) . map ( | node_index | self . unsafe_entry_for_id ( node_index ) . node ( ) . clone ( ) ) . collect ( ) } ) }
Detect whether adding an edge from src to dst would create a cycle and returns a path which
would represent the cycle if an edge were added from src to dst.
Detect whether adding an edge from src to dst would create a cycle and returns a path which would represent the cycle if an edge were added from src to dst .
&self
src_id
EntryId
dst_id
EntryId
should_include_edge
impl Fn(EdgeId) -> bool
&self
src_id
EntryId
dst_id
EntryId
should_include_edge
impl Fn(EdgeId) -> bool