API reference
Index
ConstrainedShortestPaths.CSPInstanceConstrainedShortestPaths.CSPInstanceConstrainedShortestPaths.ForwardCSPInstanceConstrainedShortestPaths.StochasticBackwardFunctionConstrainedShortestPaths.StochasticBackwardResourceConstrainedShortestPaths.StochasticForwardFunctionConstrainedShortestPaths.StochasticForwardResourceConstrainedShortestPaths.basic_shortest_pathConstrainedShortestPaths.compute_boundsConstrainedShortestPaths.generalized_a_starConstrainedShortestPaths.generalized_a_starConstrainedShortestPaths.generalized_a_star_with_thresholdConstrainedShortestPaths.generalized_a_star_with_thresholdConstrainedShortestPaths.generalized_constrained_shortest_pathConstrainedShortestPaths.generalized_constrained_shortest_path_with_thresholdConstrainedShortestPaths.resource_shortest_pathConstrainedShortestPaths.stochastic_routing_shortest_pathConstrainedShortestPaths.stochastic_routing_shortest_path_with_threshold
Docstrings
ConstrainedShortestPaths.CSPInstance — Typestruct CSPInstance{T, G<:Graphs.AbstractGraph{T}, FR, BR, C, FF<:(AbstractMatrix), BF<:(AbstractMatrix)} <: ConstrainedShortestPaths.AbstractCSPInstanceFields
graph::Graphs.AbstractGraph: acyclic digraph in which to compute the shortest pathorigin_vertex::Any: origin vertex of pathdestination_vertex::Any: destination vertex of pathorigin_forward_resource::Any: forward resource at the origin vertexdestination_backward_resource::Any: backward resource at the destination vertexcost_function::Any: cost functionforward_functions::AbstractMatrix: forward functions along edgesbackward_functions::AbstractMatrix: backward functions along edgesis_useful::BitVector: bit vector indicating if a vertices will be useful in the path computation, i.e. if there is a path from origin to destination that goes through ittopological_ordering::Vector: precomputed topological ordering of useful vertices, from destination to source
ConstrainedShortestPaths.CSPInstance — MethodCSPInstance(
;
graph,
origin_vertex,
destination_vertex,
origin_forward_resource,
destination_backward_resource,
cost_function,
forward_functions,
backward_functions,
topological_ordering
)
Constructor for CSPInstance.
ConstrainedShortestPaths.ForwardCSPInstance — Typestruct ForwardCSPInstance{T, G<:Graphs.AbstractGraph{T}, FR, C, FF<:(AbstractMatrix)} <: ConstrainedShortestPaths.AbstractCSPInstanceFields
graph::Graphs.AbstractGraph: acyclic digraph in which to compute the shortest pathorigin_vertex::Any: origin vertex of pathdestination_vertex::Any: destination vertex of pathorigin_forward_resource::Any: forward resource at the origin vertexcost_function::Any: cost functionforward_functions::AbstractMatrix: forward functions along edgesis_useful::BitVector: bit vector indicating if a vertices will be useful in the path computation, i.e. if there is a path from origin to destination that goes through ittopological_ordering::Vector: precomputed topological ordering of useful vertices, from destination to source
ConstrainedShortestPaths.StochasticBackwardFunction — Typestruct StochasticBackwardFunctionFields
slacks::Vector{Float64}: arc slack for each scenariointrinsic_delays::Vector{Float64}: intrinsic delay for each scenario of arc headλ_value::Float64: dual variable of arc head
ConstrainedShortestPaths.StochasticBackwardResource — Typestruct StochasticBackwardResource{is_convex}Fields
g::Vector{PiecewiseLinearFunctions.PiecewiseLinearFunction{Float64}}: piecewise linear function for each scenario, take as input propagated delay and outputs total delay of partail path
ConstrainedShortestPaths.StochasticForwardFunction — Typestruct StochasticForwardFunctionFields
slacks::Vector{Float64}: arc slack for each scenariointrinsic_delays::Vector{Float64}: intrinsic delay for each scenario of arc headλ_value::Float64: dual variable of arc tail
ConstrainedShortestPaths.StochasticForwardResource — Typestruct StochasticForwardResourceFields
path_cost::Float64: partial cost of the associated path (not counting task at end of path)delays::Vector{Float64}: current task (end of path) delay for each scenario
ConstrainedShortestPaths.basic_shortest_path — Methodbasic_shortest_path(
graph::Graphs.AbstractGraph{T},
s,
t;
...
) -> Union{NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}, NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}}
basic_shortest_path(
graph::Graphs.AbstractGraph{T},
s,
t,
distmx::AbstractMatrix;
bounding
) -> Union{NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}, NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}}
Compute shortest path between vertices s and t of graph graph.
Arguments
graph::AbstractGraph: acyclic directed graph.distmx::AbstractMatrix:distmx[i, j]corresponds to the distance between verticesiandjalong edge(i, j)ofgraph.
Returns
p_star::Vector{Int}: optimal path found.c_star::Float64: length of pathp_star.
ConstrainedShortestPaths.compute_bounds — Methodcompute_bounds(
instance::CSPInstance{T, G, FR, BR};
kwargs...
) -> Dict{Int64}
Compute backward bounds of instance (see Computing bounds).
ConstrainedShortestPaths.generalized_a_star — Methodgeneralized_a_star(
instance::ConstrainedShortestPaths.ForwardCSPInstance;
kwargs...
) -> NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}
Label dominance dynamic programming without bounding.
ConstrainedShortestPaths.generalized_a_star — Methodgeneralized_a_star(
instance::CSPInstance{T, G, FR},
bounds;
kwargs...
) -> NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Any}}
Perform generalized A star algorithm on instnace using bounds (see Generalized A^\star).
ConstrainedShortestPaths.generalized_a_star_with_threshold — Methodgeneralized_a_star_with_threshold(
instance::CSPInstance,
bounds,
threshold::Float64;
kwargs...
) -> @NamedTuple{p_star::Vector{Vector{Int64}}, c_star::Vector{Float64}}
Compute all paths below threshold.
ConstrainedShortestPaths.generalized_a_star_with_threshold — Methodgeneralized_a_star_with_threshold(
instance::ConstrainedShortestPaths.ForwardCSPInstance,
threshold::Float64;
kwargs...
) -> @NamedTuple{p_star::Vector{Vector{Int64}}, c_star::Vector{Float64}}
Compute all paths below threshold.
ConstrainedShortestPaths.generalized_constrained_shortest_path — Methodgeneralized_constrained_shortest_path(
instance::CSPInstance;
kwargs...
) -> NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}
Compute the shortest path of instance.
ConstrainedShortestPaths.generalized_constrained_shortest_path_with_threshold — Methodgeneralized_constrained_shortest_path_with_threshold(
instance::CSPInstance,
threshold::Float64;
kwargs...
) -> @NamedTuple{p_star::Vector{Vector{Int64}}, c_star::Vector{Float64}}
Compute shortest path between first and last nodes of instance
ConstrainedShortestPaths.resource_shortest_path — Methodresource_shortest_path(
graph::Graphs.AbstractGraph{T},
s,
t,
max_costs::AbstractVector,
distmx::AbstractMatrix,
costmx::Array{Float64, 3};
bounding
) -> Union{NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}, NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}}
Compute resource contrained shortest path between vertices s and t of graph g.
Arguments
g::AbstractGraph: acyclic directed graph.max_costs::AbstractVector: list of upper bounds for each resource constraint.distmx::AbstractMatrix:distmx[i, j]corresponds to the distance between verticesiandjalong edge(i, j)ofg.costmx::Array{Float64, 3}:cost_mx[i, j, k]corresponds to the resource cost of edge(i, j)for thekth resource constraint.
Returns
p_star::Vector{Int}: optimal path found.c_star::Float64: length of pathp_star.
ConstrainedShortestPaths.stochastic_routing_shortest_path — Methodstochastic_routing_shortest_path(
graph::Graphs.AbstractGraph{T},
slacks::AbstractMatrix,
intrinsic_delays::AbstractMatrix;
...
) -> Union{NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}, NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}}
stochastic_routing_shortest_path(
graph::Graphs.AbstractGraph{T},
slacks::AbstractMatrix,
intrinsic_delays::AbstractMatrix,
λ_values::AbstractVector;
origin_vertex,
destination_vertex,
bounding,
use_convex_resources
) -> Union{NamedTuple{(:p_star, :c_star, :info, :bounds), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_bounds::Int64, nb_cuts_with_dominance::Int64}, Dict{Int64}}}, NamedTuple{(:p_star, :c_star, :info), <:Tuple{Vector, Any, @NamedTuple{nb_cuts_with_dominance::Int64}}}}
Compute stochastic routing shortest path between origin_vertex and destination_vertex vertices of graph graph.
Arguments
graph::AbstractGraph: acyclic directed graph.slacks:slacks[i, j]corresponds to the time slack betweeniandj.delays:delays[i, ω]corresponds to delay ofifor scenarioω.
Returns
p_star::Vector{Int}: optimal path found.c_star::Float64: length of pathp_star.
ConstrainedShortestPaths.stochastic_routing_shortest_path_with_threshold — Methodstochastic_routing_shortest_path_with_threshold(
graph::Graphs.AbstractGraph{T},
slacks::AbstractMatrix,
delays::AbstractMatrix;
...
)
stochastic_routing_shortest_path_with_threshold(
graph::Graphs.AbstractGraph{T},
slacks::AbstractMatrix,
delays::AbstractMatrix,
λ_values::AbstractVector;
origin_vertex,
destination_vertex,
bounding,
use_convex_resources,
threshold
)
Threshold version of stochastic_routing_shortest_path.