Skip to content

Commit

Permalink
Switch to dijkstra_shortest_paths
Browse files Browse the repository at this point in the history
Dijkstra is a well-known algorithm with good performance records, unlike Pape.
  • Loading branch information
dourouc05 committed Oct 25, 2022
1 parent acae6ff commit 3858417
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Seleroute"
uuid = "d2f42c57-c897-4e08-8218-a119b5759c84"
authors = ["Thibaut Cuvelier <cuvelier.thibaut@gmail.com>"]
repo = "https://github.com/dourouc05/Seleroute.jl.git"
version = "0.2.0"
version = "0.2.1"

[deps]
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Expand Down
4 changes: 2 additions & 2 deletions src/compute/certain/certain_cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function _mintotload_solve_pricing_problem_master(rd::RoutingData,
end

# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down Expand Up @@ -218,7 +218,7 @@ function _minmaxload_solve_pricing_problem_master(rd::RoutingData,
end

# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down
2 changes: 1 addition & 1 deletion src/compute/certain/mmf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function _mmf_solve_pricing_problem(rd::RoutingData, dual_values_capacity, dual_
rd.logmessage("Pricing for $demand")

# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down
4 changes: 2 additions & 2 deletions src/compute/oblivious/iter_pathcg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function _oblivious_iterative_solve_pricing_problem_master(rd::RoutingData,
end

# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down Expand Up @@ -102,7 +102,7 @@ function _oblivious_iterative_solve_pricing_problem_subproblem(rd::RoutingData,
# Perform the actual pricing.
for demand in demands(rd)
# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down
2 changes: 1 addition & 1 deletion src/compute/oblivious/rr_pathcg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function _oblivious_reformulation_solve_pricing_problem(rd::RoutingData, dual_va
end

# Compute the shortest path for this demand.
state = desopo_pape_shortest_paths(rd.g, src(demand), weight_matrix)
state = dijkstra_shortest_paths(rd.g, src(demand), weight_matrix)

# Is there a solution? Has this path a negative reduced cost?
if all(state.parents .== 0)
Expand Down
2 changes: 1 addition & 1 deletion src/data/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function flow_routing_to_path(data::RoutingData, routing::AbstractMatrix{Float64
weight_e(e) = get_prop(ug, e, :weight)
while ne(ug) > 0
# Get a path arbitrarily (easiest to compute: shortest one)
sp = desopo_pape_shortest_paths(ug, src(d))
sp = dijkstra_shortest_paths(ug, src(d))
path_vertices = enumerate_paths(sp, dst(d))
path = map(Edge, zip(path_vertices[1:end-1], path_vertices[2:end]))
if length(path) == 0
Expand Down

2 comments on commit 3858417

@dourouc05
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/71005

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 3858417d55f0be0de1f73f39ac162432ec7fc54e
git push origin v0.2.1

Please sign in to comment.