@@ -3,14 +3,13 @@ $TYPEDSIGNATURES
33
44Compute backward bounds of instance (see [Computing bounds](@ref)).
55"""
6- function compute_bounds (instance:: CSPInstance ; kwargs... )
6+ function compute_bounds (instance:: CSPInstance{T,G,FR,BR} ; kwargs... ) where {T,G,FR,BR}
77 (; graph, destination_vertex, topological_ordering, is_useful) = instance
88
99 vertices_order = topological_ordering
1010 @assert vertices_order[1 ] == destination_vertex
1111
12- bounds = Dict {Int,typeof(instance.destination_backward_resource)} ()
13- # bounds = Vector{typeof(instance.destination_backward_resource)}(undef, nv(graph))
12+ bounds = Dict {Int,BR} ()
1413 bounds[destination_vertex] = instance. destination_backward_resource
1514
1615 for vertex in vertices_order[2 : end ]
@@ -30,7 +29,7 @@ $TYPEDSIGNATURES
3029Perform generalized A star algorithm on instnace using bounds
3130(see [Generalized `A^\\ star`](@ref)).
3231"""
33- function generalized_a_star (instance:: CSPInstance , bounds; kwargs... )
32+ function generalized_a_star (instance:: CSPInstance{T,G,FR} , bounds; kwargs... ) where {T,G,FR}
3433 (; graph, origin_vertex, destination_vertex, is_useful) = instance
3534 nb_vertices = nv (graph)
3635
@@ -42,8 +41,8 @@ function generalized_a_star(instance::CSPInstance, bounds; kwargs...)
4241 instance. cost_function (forward_resources[empty_path], bounds[origin_vertex]),
4342 )
4443
45- forward_type = typeof (forward_resources[empty_path])
46- M = [forward_type [] for _ in 1 : nb_vertices]
44+ # forward_type = typeof(forward_resources[empty_path])
45+ M = [FR [] for _ in 1 : nb_vertices]
4746 push! (M[origin_vertex], forward_resources[empty_path])
4847 c_star = Inf
4948 p_star = [origin_vertex]
0 commit comments