fellowship 0.0.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28eff40208410ec2a492eb13c2de4a65d26d88e2060568d8c0ebd6fc4acf2c13
4
- data.tar.gz: 22d967852a4c19855bf63c6408194ccf62f8942b3287dc3baaf9e5bfc4c3e7d2
3
+ metadata.gz: 143f97ad0023b7bd78ade3a581fce3b4f6962c602115b8be0c80e2f063a28475
4
+ data.tar.gz: ba3a34c3c04b4ec3c5d9efef6703195d6a89bf9915709e093ae1d63c40a9e7a1
5
5
  SHA512:
6
- metadata.gz: 99468a71a011a699ea0a5c4dc226e5ff29fa65e8b66ad3e1a1f73cbc1f398730c8ae1df9add1a1318bb7fb7923593065b020a0cc3c1df6b68c6998355fcbbdb3
7
- data.tar.gz: 889941fe15b65a05ae93b7e82cd5f0d3af78dbe5e9fb97a95c9d22365d99a3a92ca3d21fd48c462a2dfdcfc1b2136eafa4e12dc7b3a33e16fd40f696ea1173cb
6
+ metadata.gz: 849b4697ae20e1f670b4a747b8f2d25508f701e7cb8af1ef96e6019a18c6ba4fa7b00f46ed81ac96877ad07de0ffcc2f39cf6a7961e2aff996c375e3190d5918
7
+ data.tar.gz: 65d73ca60fbdf75c7ce88fa5be81c2fff4079743541ecc3adedd1ef59193cafa6404d4b4554ba49406660d18151aaa4f88b3b7354f7f91b9d20979533a42e417
data/README.md CHANGED
@@ -38,6 +38,12 @@ Fellowship::Fellowship.find_a_route(start_id, end_id, segments, endpoint1, endpo
38
38
  Fellowship::Fellowship.find_shortest_route(start_id, end_id, segments, endpoint1, endpoint2, distance)
39
39
  ```
40
40
 
41
+ `segments` is an array of hashes; `endpoint1`, `endpoint2`, and `distance` are keys in those hashes.
42
+
43
+ The first syntax is faster and is ideal for graphs without loops or graphs where all segments are of equal length
44
+
45
+ #### Examples
46
+
41
47
  Finding a route with the fewest number of segments or steps:
42
48
 
43
49
  ```ruby
@@ -144,7 +150,16 @@ segments = [
144
150
  {id: 455, nw_end: 1022, se_end: 1113, distance: 9.27321379585551}
145
151
  ]
146
152
 
153
+ bag_end_id = 1008
154
+ orodruin_id = 1017
147
155
 
156
+ p Fellowship::Fellowship.find_a_route(bag_end_id, orodruin_id, segments, :nw_end, :se_end) # => {:route=>[407, 410, 415, 408, 412, 416, 418, 424, 426, 493, 494, 495, 458, 459, 460, 461, 462, 463, 470, 464, 466, 467, 468, 417, 435, 483, 484, 485, 486, 487, 488, 489, 490, 491, 429, 438, 455, 456], :tail=>1017}
157
+ ```
158
+
159
+ Finding the shortest route:
160
+
161
+ ```ruby
162
+ p Fellowship::Fellowship.find_shortest_route(bag_end_id, orodruin_id, segments, :nw_end, :se_end, :distance) # => {:route=>[407, 410, 415, 408, 412, 416, 418, 424, 426, 493, 494, 495, 458, 459, 460, 461, 462, 463, 470, 464, 466, 467, 468, 417, 435, 483, 484, 485, 486, 487, 488, 489, 490, 491, 429, 438, 455, 456], :tail=>1017}
148
163
  ```
149
164
 
150
165
  ## Contributing
Binary file
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["joshsarna@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Algorithm assistance}
13
- spec.description = %q{A collection of methods to help solving technical exercises in ruby}
13
+ spec.description = %q{A collection of methods to help solving technical exercises in ruby; see https://github.com/joshsarna/fellowship}
14
14
  spec.homepage = "http://rubygems.org/gems/fellowship"
15
15
  spec.license = "MIT"
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Fellowship
2
- VERSION = "0.0.7"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fellowship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshsarna
@@ -10,7 +10,8 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A collection of methods to help solving technical exercises in ruby
13
+ description: A collection of methods to help solving technical exercises in ruby;
14
+ see https://github.com/joshsarna/fellowship
14
15
  email:
15
16
  - joshsarna@gmail.com
16
17
  executables: []
@@ -28,14 +29,16 @@ files:
28
29
  - Rakefile
29
30
  - bin/console
30
31
  - bin/setup
31
- - fellowship-0.0.1.gem
32
- - fellowship-0.0.2.gem
33
- - fellowship-0.0.3.gem
34
- - fellowship-0.0.4.gem
35
- - fellowship-0.0.5.gem
32
+ - fellowship-0.0.7.gem
36
33
  - fellowship.gemspec
37
34
  - lib/fellowship.rb
38
35
  - lib/fellowship/version.rb
36
+ - old_versions/fellowship-0.0.1.gem
37
+ - old_versions/fellowship-0.0.2.gem
38
+ - old_versions/fellowship-0.0.3.gem
39
+ - old_versions/fellowship-0.0.4.gem
40
+ - old_versions/fellowship-0.0.5.gem
41
+ - old_versions/fellowship-0.0.6.gem
39
42
  homepage: http://rubygems.org/gems/fellowship
40
43
  licenses:
41
44
  - MIT