@@ -3,14 +3,13 @@ $TYPEDSIGNATURES
3
3
4
4
Compute backward bounds of instance (see [Computing bounds](@ref)).
5
5
"""
6
- function compute_bounds (instance:: CSPInstance ; kwargs... )
6
+ function compute_bounds (instance:: CSPInstance{T,G,FR,BR} ; kwargs... ) where {T,G,FR,BR}
7
7
(; graph, destination_vertex, topological_ordering, is_useful) = instance
8
8
9
9
vertices_order = topological_ordering
10
10
@assert vertices_order[1 ] == destination_vertex
11
11
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} ()
14
13
bounds[destination_vertex] = instance. destination_backward_resource
15
14
16
15
for vertex in vertices_order[2 : end ]
@@ -30,7 +29,7 @@ $TYPEDSIGNATURES
30
29
Perform generalized A star algorithm on instnace using bounds
31
30
(see [Generalized `A^\\ star`](@ref)).
32
31
"""
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}
34
33
(; graph, origin_vertex, destination_vertex, is_useful) = instance
35
34
nb_vertices = nv (graph)
36
35
@@ -42,8 +41,8 @@ function generalized_a_star(instance::CSPInstance, bounds; kwargs...)
42
41
instance. cost_function (forward_resources[empty_path], bounds[origin_vertex]),
43
42
)
44
43
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]
47
46
push! (M[origin_vertex], forward_resources[empty_path])
48
47
c_star = Inf
49
48
p_star = [origin_vertex]
0 commit comments