Skip to main content

Graph

Trait Graph 

Source
pub trait Graph<Node, Cost> {
    // Required methods
    fn neighbors(&self, node: Node, neighbors: &mut Vec<NodeCost<Node, Cost>>);
    fn heuristic(&self, node: Node, goal: Node) -> Cost;
}
Expand description

Responsible for providing the graph structure for A* search.

Required Methods§

Source

fn neighbors(&self, node: Node, neighbors: &mut Vec<NodeCost<Node, Cost>>)

Adds the neighbors of the node with their edge costs to the neighbors buffer.

Source

fn heuristic(&self, node: Node, goal: Node) -> Cost

Estimates the lower limit of the cost from the node to the goal.

Implementors§