graph_matching 0.0.2 → 0.1.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +35 -0
  3. data/.rubocop_todo.yml +29 -256
  4. data/CHANGELOG.md +8 -2
  5. data/Rakefile +3 -3
  6. data/benchmark/mcm_bipartite/complete_bigraphs/benchmark.rb +1 -1
  7. data/benchmark/mcm_general/complete_graphs/benchmark.rb +1 -1
  8. data/benchmark/mwm_bipartite/complete_bigraphs/benchmark.rb +1 -1
  9. data/benchmark/mwm_bipartite/misc/calc_d2/benchmark.rb +1 -5
  10. data/benchmark/mwm_general/complete_graphs/benchmark.rb +2 -2
  11. data/benchmark/mwm_general/incomplete_graphs/benchmark.rb +6 -7
  12. data/graph_matching.gemspec +7 -11
  13. data/lib/graph_matching/algorithm/mcm_bipartite.rb +9 -8
  14. data/lib/graph_matching/algorithm/mcm_general.rb +2 -2
  15. data/lib/graph_matching/algorithm/mwm_bipartite.rb +25 -25
  16. data/lib/graph_matching/algorithm/mwm_general.rb +121 -117
  17. data/lib/graph_matching/algorithm/mwmg_delta_assertions.rb +47 -50
  18. data/lib/graph_matching/assertion.rb +4 -4
  19. data/lib/graph_matching/core_ext/set.rb +1 -1
  20. data/lib/graph_matching/graph/bigraph.rb +1 -1
  21. data/lib/graph_matching/graph/graph.rb +1 -1
  22. data/lib/graph_matching/graph/weighted.rb +11 -8
  23. data/lib/graph_matching/integer_vertexes.rb +2 -2
  24. data/lib/graph_matching/version.rb +1 -1
  25. data/lib/graph_matching/visualize.rb +5 -5
  26. data/profile/mwm_general/profile.rb +1 -1
  27. data/spec/graph_matching/algorithm/mcm_bipartite_spec.rb +1 -1
  28. data/spec/graph_matching/algorithm/mcm_general_spec.rb +1 -1
  29. data/spec/graph_matching/algorithm/mwm_bipartite_spec.rb +1 -1
  30. data/spec/graph_matching/algorithm/mwm_general_spec.rb +44 -41
  31. data/spec/graph_matching/graph/graph_spec.rb +4 -4
  32. data/spec/graph_matching/integer_vertexes_spec.rb +2 -2
  33. data/spec/spec_helper.rb +2 -2
  34. metadata +17 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b971f95f4fc1d0dfb6cf60d58d5cfc1f3103cbc1
4
- data.tar.gz: c582a34162596ff934b3c6ad53adf6f64c8971d2
3
+ metadata.gz: 75943778dce16d1e6f5bf9e86199bdbf3e30a45b
4
+ data.tar.gz: 9258fed75664e830dddb78fdc1ce82dacc07ea06
5
5
  SHA512:
6
- metadata.gz: 4379ceea72d7ae304ab0cf13b75266c445f05d7fc5287b5de264071174dfa2f7dcd2a1405d3e0032a6e5e9571af34b41adacd5f8c10b7f034fdaea9647dc1559
7
- data.tar.gz: 9488a79b47ad0f8e2740b2262c7e0ae96155945c3457abcc4927fa0eb94c15b1e325eceaee3ec125b2e4d54e3c69dca10855efd45fde449f0dad5e171bc5a95a
6
+ metadata.gz: 9482a5b19a93be3dca8fb5d1b39fed81e2582f642e7a436c390d736284e3a949a74bc905a9d8ecc8b81dd9e8d99d70b86056797d5a42a6f6099d3a72d2190803
7
+ data.tar.gz: 029e68cbfd6f91d73165e2f01aa4f7ba411e5291e23bf5e459a3623461a68feb87f1e78abbffc8bd7d3931ef16e75868a6c865c84622b27321007d338adcaf83
@@ -2,3 +2,38 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  TargetRubyVersion: 2.0
5
+
6
+ # Not useful compared to metrics like AbcSize
7
+ Metrics/BlockLength:
8
+ Enabled: false
9
+
10
+ # Not useful compared to metrics like AbcSize
11
+ Metrics/ClassLength:
12
+ Enabled: false
13
+
14
+ # Not useful compared to metrics like AbcSize
15
+ Metrics/MethodLength:
16
+ Enabled: false
17
+
18
+ # Avoid postfix conditionals, except on the shortest of lines. Never use postfix
19
+ # conditional after an assignment.
20
+ Style/IfUnlessModifier:
21
+ Enabled: false
22
+
23
+ Style/MultilineOperationIndentation:
24
+ EnforcedStyle: indented
25
+
26
+ # For this project, where performance matters, do not use the nil predicate method
27
+ # (`nil?`), as it is slower than the `==` operator.
28
+ Style/NilComparison:
29
+ Enabled: false
30
+
31
+ # For this project, where performance matters, do not use numeric predicate methods like
32
+ # `zero?`, as they are about 25% slower than optimized operators like `==`.
33
+ Style/NumericPredicate:
34
+ Enabled: false
35
+
36
+ # Avoid postfix conditionals, except on very short lines. Never use postfix conditionals
37
+ # after variable assignment, regardless of line length.
38
+ Style/WhileUntilModifier:
39
+ Enabled: false
@@ -1,71 +1,20 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2016-08-14 21:49:39 -0400 using RuboCop version 0.42.0.
4
- # The point is for the user to remove these configuration records
1
+ # Remove these configuration records
5
2
  # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- # Configuration parameters: AllowSafeAssignment.
11
- Lint/AssignmentInCondition:
12
- Exclude:
13
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
14
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
15
-
16
- # Offense count: 6
17
- Lint/LiteralInCondition:
18
- Exclude:
19
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
20
- - 'lib/graph_matching/algorithm/mcm_general.rb'
21
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
22
- - 'lib/graph_matching/algorithm/mwm_general.rb'
23
-
24
- # Offense count: 7
25
- Lint/ShadowingOuterLocalVariable:
26
- Exclude:
27
- - 'lib/graph_matching/algorithm/mwm_general.rb'
28
-
29
- # Offense count: 4
30
- Lint/UselessAssignment:
31
- Exclude:
32
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
33
- - 'lib/graph_matching/algorithm/mwm_general.rb'
34
3
 
35
4
  # Offense count: 24
36
5
  Metrics/AbcSize:
37
- Max: 82
38
-
39
- # Offense count: 3
40
- Metrics/BlockNesting:
41
- Max: 4
42
-
43
- # Offense count: 2
44
- # Configuration parameters: CountComments.
45
- Metrics/ClassLength:
46
- Max: 564
6
+ Max: 75
47
7
 
48
8
  # Offense count: 8
49
9
  Metrics/CyclomaticComplexity:
50
10
  Max: 17
51
11
 
52
- # Offense count: 12
53
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
54
- # URISchemes: http, https
55
- Metrics/LineLength:
56
- Max: 88
57
-
58
- # Offense count: 27
59
- # Configuration parameters: CountComments.
60
- Metrics/MethodLength:
61
- Max: 69
62
-
63
12
  # Offense count: 1
64
13
  # Configuration parameters: CountKeywordArgs.
65
14
  Metrics/ParameterLists:
66
15
  Max: 7
67
16
 
68
- # Offense count: 8
17
+ # Offense count: 7
69
18
  Metrics/PerceivedComplexity:
70
19
  Max: 17
71
20
 
@@ -83,11 +32,6 @@ Style/AsciiComments:
83
32
  - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
84
33
  - 'lib/graph_matching/algorithm/mwm_general.rb'
85
34
 
86
- # Offense count: 3
87
- Style/AsciiIdentifiers:
88
- Exclude:
89
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
90
-
91
35
  # Offense count: 18
92
36
  # Cop supports --auto-correct.
93
37
  # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
@@ -112,6 +56,14 @@ Style/CommentIndentation:
112
56
  Exclude:
113
57
  - 'lib/graph_matching/algorithm/mcm_general.rb'
114
58
 
59
+ # Offense count: 1
60
+ # Cop supports --auto-correct.
61
+ # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
62
+ # SupportedStyles: assign_to_condition, assign_inside_condition
63
+ Style/ConditionalAssignment:
64
+ Exclude:
65
+ - 'lib/graph_matching/algorithm/mwm_general.rb'
66
+
115
67
  # Offense count: 2
116
68
  # Cop supports --auto-correct.
117
69
  # Configuration parameters: EnforcedStyle, SupportedStyles.
@@ -120,7 +72,13 @@ Style/EmptyElse:
120
72
  Exclude:
121
73
  - 'lib/graph_matching/algorithm/mwm_general.rb'
122
74
 
123
- # Offense count: 2
75
+ # Offense count: 1
76
+ # Cop supports --auto-correct.
77
+ Style/EmptyLineAfterMagicComment:
78
+ Exclude:
79
+ - 'graph_matching.gemspec'
80
+
81
+ # Offense count: 3
124
82
  # Cop supports --auto-correct.
125
83
  # Configuration parameters: EnforcedStyle, SupportedStyles.
126
84
  # SupportedStyles: empty_lines, no_empty_lines
@@ -128,10 +86,10 @@ Style/EmptyLinesAroundBlockBody:
128
86
  Exclude:
129
87
  - 'lib/graph_matching/algorithm/mcm_general.rb'
130
88
 
131
- # Offense count: 7
89
+ # Offense count: 6
132
90
  # Cop supports --auto-correct.
133
91
  # Configuration parameters: EnforcedStyle, SupportedStyles.
134
- # SupportedStyles: empty_lines, no_empty_lines
92
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
135
93
  Style/EmptyLinesAroundClassBody:
136
94
  Exclude:
137
95
  - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
@@ -148,7 +106,7 @@ Style/EmptyLinesAroundMethodBody:
148
106
  # Offense count: 7
149
107
  # Cop supports --auto-correct.
150
108
  # Configuration parameters: EnforcedStyle, SupportedStyles.
151
- # SupportedStyles: empty_lines, no_empty_lines
109
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
152
110
  Style/EmptyLinesAroundModuleBody:
153
111
  Exclude:
154
112
  - 'lib/graph_matching/algorithm/matching_algorithm.rb'
@@ -168,14 +126,7 @@ Style/FormatString:
168
126
  - 'benchmark/mwm_general/complete_graphs/benchmark.rb'
169
127
  - 'benchmark/mwm_general/incomplete_graphs/benchmark.rb'
170
128
 
171
- # Offense count: 44
172
- # Cop supports --auto-correct.
173
- # Configuration parameters: EnforcedStyle, SupportedStyles.
174
- # SupportedStyles: when_needed, always
175
- Style/FrozenStringLiteralComment:
176
- Enabled: false
177
-
178
- # Offense count: 12
129
+ # Offense count: 16
179
130
  # Configuration parameters: MinBodyLength.
180
131
  Style/GuardClause:
181
132
  Exclude:
@@ -188,201 +139,23 @@ Style/GuardClause:
188
139
 
189
140
  # Offense count: 1
190
141
  # Cop supports --auto-correct.
191
- # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
192
- # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
193
- Style/HashSyntax:
194
- Exclude:
195
- - 'Rakefile'
196
-
197
- # Offense count: 23
198
- # Cop supports --auto-correct.
199
- # Configuration parameters: MaxLineLength.
200
- Style/IfUnlessModifier:
201
- Exclude:
202
- - 'lib/graph_matching/algorithm/mcm_general.rb'
203
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
204
- - 'lib/graph_matching/algorithm/mwm_general.rb'
205
- - 'lib/graph_matching/algorithm/mwmg_delta_assertions.rb'
206
- - 'lib/graph_matching/assertion.rb'
207
- - 'lib/graph_matching/core_ext/set.rb'
208
- - 'lib/graph_matching/matching.rb'
209
-
210
- # Offense count: 2
211
- # Cop supports --auto-correct.
212
- # Configuration parameters: SupportedStyles, IndentationWidth.
213
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
214
- Style/IndentArray:
215
- EnforcedStyle: consistent
216
-
217
- # Offense count: 6
218
- # Cop supports --auto-correct.
219
- Style/InfiniteLoop:
220
- Exclude:
221
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
222
- - 'lib/graph_matching/algorithm/mcm_general.rb'
223
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
224
- - 'lib/graph_matching/algorithm/mwm_general.rb'
225
-
226
- # Offense count: 1
227
- # Configuration parameters: EnforcedStyle, SupportedStyles.
228
- # SupportedStyles: snake_case, camelCase
229
- Style/MethodName:
230
- Exclude:
231
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
232
-
233
- # Offense count: 4
234
- # Cop supports --auto-correct.
235
- # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
236
- # SupportedStyles: aligned, indented
237
- Style/MultilineOperationIndentation:
238
- Exclude:
239
- - 'lib/graph_matching/algorithm/mwm_general.rb'
240
- - 'lib/graph_matching/algorithm/mwmg_delta_assertions.rb'
241
-
242
- # Offense count: 5
243
- # Cop supports --auto-correct.
244
- Style/MutableConstant:
245
- Exclude:
246
- - 'lib/graph_matching/algorithm/mwm_general.rb'
247
- - 'lib/graph_matching/version.rb'
248
- - 'lib/graph_matching/visualize.rb'
249
- - 'spec/graph_matching/graph/graph_spec.rb'
250
-
251
- # Offense count: 11
252
- # Cop supports --auto-correct.
253
- # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
254
- # SupportedStyles: skip_modifier_ifs, always
255
- Style/Next:
256
- Exclude:
257
- - 'benchmark/mwm_general/incomplete_graphs/benchmark.rb'
258
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
259
- - 'lib/graph_matching/algorithm/mwm_general.rb'
260
- - 'lib/graph_matching/algorithm/mwmg_delta_assertions.rb'
261
-
262
- # Offense count: 5
263
- # Cop supports --auto-correct.
264
- Style/NilComparison:
265
- Exclude:
266
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
267
- - 'lib/graph_matching/algorithm/mwm_general.rb'
268
-
269
- # Offense count: 14
270
- # Cop supports --auto-correct.
271
142
  # Configuration parameters: EnforcedStyle, SupportedStyles.
272
- # SupportedStyles: predicate, comparison
273
- Style/NumericPredicate:
143
+ # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
144
+ Style/IndentHeredoc:
274
145
  Exclude:
275
- - 'lib/graph_matching/algorithm/mcm_general.rb'
276
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
277
- - 'lib/graph_matching/algorithm/mwm_general.rb'
278
- - 'lib/graph_matching/matching.rb'
146
+ - 'lib/graph_matching/errors.rb'
279
147
 
280
148
  # Offense count: 2
281
149
  # Cop supports --auto-correct.
282
- Style/ParallelAssignment:
283
- Exclude:
284
- - 'lib/graph_matching/graph/weighted.rb'
285
-
286
- # Offense count: 1
287
- # Cop supports --auto-correct.
288
150
  # Configuration parameters: PreferredDelimiters.
289
151
  Style/PercentLiteralDelimiters:
290
- Exclude:
291
- - 'spec/graph_matching/integer_vertexes_spec.rb'
292
-
293
- # Offense count: 1
294
- # Cop supports --auto-correct.
295
- Style/PreferredHashMethods:
296
- Exclude:
297
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
298
-
299
- # Offense count: 3
300
- # Cop supports --auto-correct.
301
- # Configuration parameters: AllowMultipleReturnValues.
302
- Style/RedundantReturn:
303
- Exclude:
304
- - 'lib/graph_matching/algorithm/mwm_general.rb'
305
- - 'lib/graph_matching/integer_vertexes.rb'
306
-
307
- # Offense count: 27
308
- # Cop supports --auto-correct.
309
- # Configuration parameters: EnforcedStyle, SupportedStyles.
310
- # SupportedStyles: only_raise, only_fail, semantic
311
- Style/SignalException:
312
- Exclude:
313
- - 'lib/graph_matching/algorithm/mcm_general.rb'
314
- - 'lib/graph_matching/algorithm/mwm_general.rb'
315
- - 'lib/graph_matching/algorithm/mwmg_delta_assertions.rb'
316
- - 'lib/graph_matching/assertion.rb'
317
- - 'lib/graph_matching/core_ext/set.rb'
318
- - 'lib/graph_matching/graph/bigraph.rb'
319
- - 'lib/graph_matching/graph/graph.rb'
320
- - 'lib/graph_matching/graph/weighted.rb'
321
- - 'lib/graph_matching/integer_vertexes.rb'
322
- - 'spec/spec_helper.rb'
323
-
324
- # Offense count: 2
325
- # Cop supports --auto-correct.
326
- Style/SpaceAfterComma:
327
- Exclude:
328
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
329
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
330
-
331
- # Offense count: 2
332
- # Cop supports --auto-correct.
333
- Style/SpaceBeforeComma:
334
- Exclude:
335
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
336
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
337
-
338
- # Offense count: 15
339
- # Cop supports --auto-correct.
340
- Style/SpaceInsideRangeLiteral:
341
- Exclude:
342
- - 'benchmark/mwm_general/complete_graphs/benchmark.rb'
343
- - 'benchmark/mwm_general/incomplete_graphs/benchmark.rb'
344
- - 'lib/graph_matching/algorithm/mwm_general.rb'
345
- - 'lib/graph_matching/algorithm/mwmg_delta_assertions.rb'
346
- - 'profile/mwm_general/profile.rb'
347
-
348
- # Offense count: 49
349
- # Cop supports --auto-correct.
350
- # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
351
- # SupportedStyles: single_quotes, double_quotes
352
- Style/StringLiterals:
353
- Exclude:
354
- - 'Rakefile'
355
- - 'lib/graph_matching/algorithm/mcm_bipartite.rb'
356
- - 'lib/graph_matching/assertion.rb'
357
- - 'lib/graph_matching/core_ext/set.rb'
358
- - 'lib/graph_matching/graph/weighted.rb'
359
- - 'lib/graph_matching/version.rb'
360
- - 'lib/graph_matching/visualize.rb'
361
- - 'spec/graph_matching/algorithm/mcm_bipartite_spec.rb'
362
- - 'spec/graph_matching/algorithm/mcm_general_spec.rb'
363
- - 'spec/graph_matching/algorithm/mwm_bipartite_spec.rb'
364
- - 'spec/graph_matching/algorithm/mwm_general_spec.rb'
365
- - 'spec/graph_matching/graph/graph_spec.rb'
366
-
367
- # Offense count: 5
368
- # Cop supports --auto-correct.
369
- Style/WhileUntilDo:
370
- Exclude:
371
- - 'lib/graph_matching/algorithm/mcm_general.rb'
372
- - 'lib/graph_matching/algorithm/mwm_bipartite.rb'
373
- - 'lib/graph_matching/algorithm/mwm_general.rb'
374
-
375
- # Offense count: 2
376
- # Cop supports --auto-correct.
377
- # Configuration parameters: MaxLineLength.
378
- Style/WhileUntilModifier:
379
152
  Exclude:
380
153
  - 'lib/graph_matching/algorithm/mwm_general.rb'
154
+ - 'spec/graph_matching/integer_vertexes_spec.rb'
381
155
 
382
156
  # Offense count: 1
383
157
  # Cop supports --auto-correct.
384
- # Configuration parameters: SupportedStyles, WordRegex.
158
+ # Configuration parameters: SupportedStyles.
385
159
  # SupportedStyles: percent, brackets
386
- Style/WordArray:
387
- EnforcedStyle: percent
388
- MinSize: 3
160
+ Style/SymbolArray:
161
+ EnforcedStyle: brackets
@@ -3,7 +3,13 @@
3
3
  This project follows [semver 2.0.0][1] and the recommendations
4
4
  of [keepachangelog.com][2].
5
5
 
6
- ## 0.0.2
6
+ ## 0.1.0 (2017-05-10)
7
+
8
+ ### Breaking Changes
9
+
10
+ - Drop support for EOL rubies (< 2.2)
11
+
12
+ ## 0.0.2 (2016-08-15)
7
13
 
8
14
  ### Breaking Changes
9
15
 
@@ -17,7 +23,7 @@ None
17
23
 
18
24
  None
19
25
 
20
- ## 0.0.1
26
+ ## 0.0.1 (2015-03-23)
21
27
 
22
28
  Initial release. All four algorithms have been implemented, but the API is still in flux.
23
29
  Also, additional input validations will probably be added.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
 
3
3
  task(:spec).clear
4
- require "rspec/core/rake_task"
4
+ require 'rspec/core/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec) do |t|
6
6
  t.verbose = false
7
7
  end
@@ -9,4 +9,4 @@ end
9
9
  require 'rubocop/rake_task'
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task :default => [:rubocop, :spec]
12
+ task default: [:rubocop, :spec]