From 3b75ff7ef226a228f4d28d6cb74848a0254296e2 Mon Sep 17 00:00:00 2001 From: Seth Bromberger Date: Thu, 9 Aug 2018 20:00:58 -0700 Subject: [PATCH] fix dijkstra pathcount overflow (#980) --- src/shortestpaths/dijkstra.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shortestpaths/dijkstra.jl b/src/shortestpaths/dijkstra.jl index f62a1b3cb..c5fc513f0 100644 --- a/src/shortestpaths/dijkstra.jl +++ b/src/shortestpaths/dijkstra.jl @@ -7,7 +7,7 @@ struct DijkstraState{T <: Real,U <: Integer} <: AbstractPathState parents::Vector{U} dists::Vector{T} predecessors::Vector{Vector{U}} - pathcounts::Vector{U} + pathcounts::Vector{UInt64} closest_vertices::Vector{U} end @@ -40,7 +40,7 @@ function dijkstra_shortest_paths(g::AbstractGraph, parents = zeros(U, nvg) visited = zeros(Bool, nvg) - pathcounts = zeros(Int, nvg) + pathcounts = zeros(UInt64, nvg) preds = fill(Vector{U}(), nvg) H = PriorityQueue{U,T}() # fill creates only one array.