pub fn find_path(&self, from: ID, to: ID) -> Result<Vec<ID>> {
        if !self.space_exists(from) {
            return Err(QDFError::SpaceDoesNotExists(from));
        }
        if !self.space_exists(to) {
            return Err(QDFError::SpaceDoesNotExists(to));
        }
        if let Some((_, spaces)) = astar(&self.graph, from, |f| f == to, |_| 0, |_| 0) {
            Ok(spaces)
        } else {
            Ok(vec![])
        }
    }
/// Gets list of space IDs that defines shortest path between two spaces,
/// or throws error if space does not exists.
///
/// # Arguments
/// * `from` - source space id.
/// * `to` - target space id.
///
/// # Returns
/// `Ok` with space ids that builds shortest path between two points, `Err` if path cannot be
/// found or spaces does not exists.
///
/// # Examples
/// ```
/// use quantized_density_fields::QDF;
///
/// let (mut qdf, root) = QDF::new(2, 9);
/// let (_, subs, _) = qdf.increase_space_density(root).unwrap();
/// let (_, subs2, _) = qdf.increase_space_density(subs[0]).unwrap();
/// assert_eq!(qdf.find_path(subs2[0], subs[2]).unwrap(), vec![subs2[0], subs2[1], subs[2]]);
/// ```
Gets list of space IDs that defines shortest path between two spaces,
or throws error if space does not exists.
Gets list of space IDs that defines shortest path between two spaces or throws error if space does not exists .
pub fn find_path(&self, from: ID, to: ID) -> Result<Vec<ID>> {
        if !self.space_exists(from) {
            return Err(QDFError::SpaceDoesNotExists(from));
        }
        if !self.space_exists(to) {
            return Err(QDFError::SpaceDoesNotExists(to));
        }
        if let Some((_, spaces)) = astar(&self.graph, from, |f| f == to, |_| 0, |_| 0) {
            Ok(spaces)
        } else {
            Ok(vec![])
        }
    }
pub fn find_path ( & self , from : ID , to : ID ) -> Result < Vec < ID > > { if ! self . space_exists ( from ) { return Err ( QDFError :: SpaceDoesNotExists ( from ) ) ; } if ! self . space_exists ( to ) { return Err ( QDFError :: SpaceDoesNotExists ( to ) ) ; } if let Some ( ( _ , spaces ) ) = astar ( & self . graph , from , | f | f == to , | _ | 0 , | _ | 0 ) { Ok ( spaces ) } else { Ok ( vec ! [ ] ) } }
Gets list of space IDs that defines shortest path between two spaces,
or throws error if space does not exists.
Gets list of space IDs that defines shortest path between two spaces or throws error if space does not exists .
&self
from
ID
to
ID
`Ok` with space ids that builds shortest path between two points, `Err` if path cannot be
found or spaces does not exists.
` Ok ` with space ids that builds shortest path between two points ` Err ` if path cannot be found or spaces does not exists .
&self
from
ID
to
ID
examples
```
use quantized_density_fields::QDF.


` ` ` use quantized_density_fields :: QDF .