Crate fast_paths[][src]

Structs

Edge
FastGraph
FastGraph32

Special graph data-structure that is identical to FastGraph except that it uses u32 integers instead of usize integers. This is used to store a FastGraph in a 32bit representation on disk when using a 64bit system.

FastGraphBuilder
InputGraph
Params
PathCalculator
ShortestPath

Constants

INVALID_EDGE
INVALID_NODE
WEIGHT_MAX
WEIGHT_ZERO

Functions

calc_path

Calculates the shortest path from source to target.

create_calculator

Creates a PathCalculator that can be used to run many shortest path calculations in a row. This is the preferred way to calculate shortest paths in case you are calculating more than one path. Use one PathCalculator for each thread.

deserialize_32

When deserializing a FastGraph in a larger struct, use #[serde(deserialize_with = "fast_paths::deserialize_32)]` to transform the graph from a 32-bit representation to the current platform’s supported size. This is necessary when serializing on a 64-bit system and deserializing on a 32-bit system, such as WASM.

get_node_ordering

Returns the node ordering of a prepared graph. This can be used to run the preparation with prepare_with_order().

prepare

Prepares the given InputGraph for fast shortest path calculations.

prepare_with_order

Prepares the given input graph using a fixed node ordering, which can be any permutation of the node ids. This can be used to speed up the graph preparation if you have done it for a similar graph with an equal number of nodes. For example if you have changed some of the edge weights only.

prepare_with_params

Like prepare(), but allows specifying some parameters used for the graph preparation.

serialize_32

When serializing a FastGraph in a larger struct, use #[serde(serialize_with = "fast_paths::serialize_32)]` to transform the graph to a 32-bit representation. This will use 50% more RAM than serializing without transformation, but the resulting size will be 50% less. It will panic if the graph has more than 2^32 nodes or edges or values for weight.

Type Definitions

EdgeId
NodeId
Weight