Skip to content

Commit

Permalink
chore: Drop lazy priority queue (#64)
Browse files Browse the repository at this point in the history
* Switch from unmaintained lazy_priority_queue to pairing_heap
* Remove not needed require lazy_priority_queue

https://github.com/matiasbattocchia/lazy_priority_queue is unfortunately
unmaintained. https://github.com/mhib/pairing_heap is a drop in replacement,
that is maintained and faster in benchmarks
  • Loading branch information
dcermak authored Aug 29, 2022
1 parent eb9d347 commit 3b1db1e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/rgl/bellman_ford.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require 'rgl/edge_properties_map'
require 'rgl/path_builder'

require 'lazy_priority_queue'

module RGL

# Bellman-Ford shortest paths algorithm has the following event points:
Expand Down
4 changes: 2 additions & 2 deletions lib/rgl/dijkstra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'rgl/edge_properties_map'
require 'rgl/path_builder'

require 'lazy_priority_queue'
require 'pairing_heap'

module RGL

Expand Down Expand Up @@ -54,7 +54,7 @@ def find_shortest_paths(source)
def init(source)
@visitor.set_source(source)

@queue = MinPriorityQueue.new
@queue = PairingHeap::MinPriorityQueue.new
@queue.push(source, 0)
end

Expand Down
2 changes: 1 addition & 1 deletion rgl.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
#### Dependencies and requirements.

s.add_dependency 'stream', '~> 0.5.3'
s.add_dependency 'lazy_priority_queue', '~> 0.1.0'
s.add_dependency 'pairing_heap', '>= 0.3.0'
s.add_dependency 'rexml', '~> 3.2', '>= 3.2.4'

s.add_development_dependency 'rake'
Expand Down

0 comments on commit 3b1db1e

Please sign in to comment.