rgl 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/ChangeLog +19 -10
  2. data/Gemfile +3 -0
  3. data/{README → README.rdoc} +70 -98
  4. data/Rakefile +44 -150
  5. data/examples/canvas.rb +63 -64
  6. data/examples/examples.rb +42 -42
  7. data/examples/graph.dot +46 -0
  8. data/examples/images/example.jpg +0 -0
  9. data/examples/images/module_graph.jpg +0 -0
  10. data/examples/images/rgl_modules.png +0 -0
  11. data/examples/{insel-der-tausend-gefahren.rb → insel_der_tausend_gefahren.rb} +18 -19
  12. data/examples/north.rb +2 -2
  13. data/examples/north2.rb +11 -11
  14. data/examples/rdep-rgl.rb +218 -222
  15. data/lib/rgl/adjacency.rb +78 -74
  16. data/lib/rgl/base.rb +160 -78
  17. data/lib/rgl/bellman_ford.rb +115 -0
  18. data/lib/rgl/bidirectional.rb +17 -10
  19. data/lib/rgl/bipartite.rb +87 -0
  20. data/lib/rgl/condensation.rb +13 -4
  21. data/lib/rgl/connected_components.rb +38 -30
  22. data/lib/rgl/dijkstra.rb +158 -0
  23. data/lib/rgl/dijkstra_visitor.rb +42 -0
  24. data/lib/rgl/dot.rb +40 -32
  25. data/lib/rgl/edge_properties_map.rb +55 -0
  26. data/lib/rgl/edmonds_karp.rb +136 -0
  27. data/lib/rgl/enumerable_ext.rb +4 -1
  28. data/lib/rgl/graph_iterator.rb +15 -0
  29. data/lib/rgl/graph_visitor.rb +138 -0
  30. data/lib/rgl/graph_wrapper.rb +15 -0
  31. data/lib/rgl/graphxml.rb +20 -10
  32. data/lib/rgl/implicit.rb +68 -66
  33. data/lib/rgl/mutable.rb +37 -31
  34. data/lib/rgl/path_builder.rb +40 -0
  35. data/lib/rgl/prim.rb +52 -0
  36. data/lib/rgl/rdot.rb +411 -374
  37. data/lib/rgl/topsort.rb +23 -16
  38. data/lib/rgl/transitivity.rb +29 -27
  39. data/lib/rgl/traversal.rb +67 -205
  40. data/rakelib/dep_graph.rake +4 -3
  41. data/test/bellman_ford_test.rb +187 -0
  42. data/test/bipartite_test.rb +47 -0
  43. data/test/components_test.rb +80 -0
  44. data/test/cycles_test.rb +60 -0
  45. data/test/dijkstra_test.rb +148 -0
  46. data/test/directed_graph_test.rb +118 -0
  47. data/test/dot_test.rb +26 -0
  48. data/test/edge_properties_map_test.rb +63 -0
  49. data/test/edge_test.rb +35 -0
  50. data/test/edmonds_karp_test.rb +105 -0
  51. data/{tests/TestGraph.rb → test/graph_test.rb} +6 -6
  52. data/test/graph_xml_test.rb +57 -0
  53. data/test/implicit_test.rb +53 -0
  54. data/test/prim_test.rb +98 -0
  55. data/{tests/TestRdot.rb → test/rdot_test.rb} +309 -308
  56. data/{tests → test}/test_helper.rb +4 -1
  57. data/{tests/TestTransitivity.rb → test/transitivity_test.rb} +43 -43
  58. data/test/traversal_test.rb +221 -0
  59. data/test/undirected_graph_test.rb +103 -0
  60. metadata +226 -145
  61. data/examples/example.jpg +0 -0
  62. data/examples/module_graph.jpg +0 -0
  63. data/install.rb +0 -49
  64. data/tests/TestComponents.rb +0 -65
  65. data/tests/TestCycles.rb +0 -61
  66. data/tests/TestDirectedGraph.rb +0 -125
  67. data/tests/TestDot.rb +0 -18
  68. data/tests/TestEdge.rb +0 -34
  69. data/tests/TestGraphXML.rb +0 -57
  70. data/tests/TestImplicit.rb +0 -52
  71. data/tests/TestTraversal.rb +0 -220
  72. data/tests/TestUnDirectedGraph.rb +0 -102
metadata CHANGED
@@ -1,184 +1,265 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rgl
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Horst Duchene
9
+ - Kirill Lashuk
8
10
  autorequire: rgl/base
9
11
  bindir: bin
10
12
  cert_chain: []
11
-
12
- date: 2008-08-27 00:00:00 -05:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
13
+ date: 2014-12-15 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: stream
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 0.5.0
17
23
  type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0.5"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: rake
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: 0.5.0
31
+ - !ruby/object:Gem::Dependency
32
+ name: algorithms
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: 0.5.0
27
39
  type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
- description: "RGL is a framework for graph data structures and algorithms. The design of the library is much influenced by the Boost Graph Library (BGL) which is written in C++ heavily using its template mechanism. RGL currently contains a core set of algorithm patterns: * Breadth First Search * Depth First Search The algorithm patterns by themselves do not compute any meaningful quantities over graphs, they are merely building blocks for constructing graph algorithms. The graph algorithms in RGL currently include: * Topological Sort * Connected Components * Strongly Connected Components * Transitive Closure * Transitive Reduction * Graph Condensation * Search cycles (contributed by Shawn Garbett)"
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 0.5.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: rdoc
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ - !ruby/object:Gem::Dependency
80
+ name: yard
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ type: :development
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ description: RGL is a framework for graph data structures and algorithms
36
96
  email: monora@gmail.com
37
97
  executables: []
38
-
39
98
  extensions: []
40
-
41
- extra_rdoc_files:
42
- - README
43
- files:
44
- - install.rb
45
- - Rakefile
99
+ extra_rdoc_files:
100
+ - README.rdoc
101
+ files:
102
+ - lib/rgl/dijkstra.rb
103
+ - lib/rgl/edmonds_karp.rb
104
+ - lib/rgl/graphxml.rb
105
+ - lib/rgl/edge_properties_map.rb
106
+ - lib/rgl/transitiv_closure.rb
107
+ - lib/rgl/condensation.rb
108
+ - lib/rgl/topsort.rb
109
+ - lib/rgl/path_builder.rb
110
+ - lib/rgl/bellman_ford.rb
111
+ - lib/rgl/graph_visitor.rb
112
+ - lib/rgl/bidirectional.rb
113
+ - lib/rgl/rdot.rb
114
+ - lib/rgl/prim.rb
115
+ - lib/rgl/adjacency.rb
116
+ - lib/rgl/implicit.rb
117
+ - lib/rgl/traversal.rb
118
+ - lib/rgl/base.rb
119
+ - lib/rgl/dot.rb
120
+ - lib/rgl/graph_iterator.rb
121
+ - lib/rgl/enumerable_ext.rb
122
+ - lib/rgl/dijkstra_visitor.rb
123
+ - lib/rgl/mutable.rb
124
+ - lib/rgl/connected_components.rb
125
+ - lib/rgl/transitivity.rb
126
+ - lib/rgl/graph_wrapper.rb
127
+ - lib/rgl/bipartite.rb
46
128
  - ChangeLog
47
- - README
48
- - tests/TestGraph.rb
49
- - tests/TestUnDirectedGraph.rb
50
- - tests/TestTransitivity.rb
51
- - tests/TestTraversal.rb
52
- - tests/TestDot.rb
53
- - tests/TestEdge.rb
54
- - tests/TestDirectedGraph.rb
55
- - tests/TestRdot.rb
56
- - tests/TestCycles.rb
57
- - tests/TestImplicit.rb
58
- - tests/test_helper.rb
59
- - tests/TestGraphXML.rb
60
- - tests/TestComponents.rb
61
- - examples/insel-der-tausend-gefahren.rb
129
+ - examples/images/module_graph.jpg
130
+ - examples/images/example.jpg
131
+ - examples/images/rgl_modules.png
132
+ - examples/insel_der_tausend_gefahren.rb
133
+ - examples/rdep-rgl.rb
134
+ - examples/graph.dot
135
+ - examples/north2.rb
62
136
  - examples/canvas.rb
63
137
  - examples/north.rb
64
- - examples/north2.rb
65
- - examples/example.jpg
66
- - examples/module_graph.jpg
67
- - examples/examples.rb
68
- - examples/rdep-rgl.rb
69
- - examples/north
70
- - examples/north/g.10.75.graphml
71
- - examples/north/g.10.0.graphml
72
- - examples/north/g.10.41.graphml
73
- - examples/north/g.10.93.graphml
74
- - examples/north/g.10.7.graphml
138
+ - examples/north/g.10.45.graphml
139
+ - examples/north/g.10.6.graphml
140
+ - examples/north/g.10.56.graphml
141
+ - examples/north/g.10.8.graphml
142
+ - examples/north/g.10.29.graphml
75
143
  - examples/north/g.10.30.graphml
144
+ - examples/north/g.10.37.graphml
145
+ - examples/north/Graph.log
76
146
  - examples/north/g.10.20.graphml
77
- - examples/north/g.10.89.graphml
78
- - examples/north/g.10.78.graphml
147
+ - examples/north/g.10.9.graphml
148
+ - examples/north/g.10.74.graphml
149
+ - examples/north/g.10.61.graphml
150
+ - examples/north/g.12.8.graphml
151
+ - examples/north/g.10.71.graphml
152
+ - examples/north/g.10.7.graphml
153
+ - examples/north/g.10.38.graphml
154
+ - examples/north/g.10.15.graphml
155
+ - examples/north/g.10.50.graphml
79
156
  - examples/north/g.10.19.graphml
80
- - examples/north/g.10.86.graphml
157
+ - examples/north/g.10.62.graphml
158
+ - examples/north/g.10.31.graphml
81
159
  - examples/north/g.10.92.graphml
82
- - examples/north/g.10.38.graphml
83
- - examples/north/g.10.14.graphml
84
- - examples/north/g.10.2.graphml
85
- - examples/north/g.10.46.graphml
86
- - examples/north/g.10.72.graphml
87
- - examples/north/g.10.24.graphml
88
- - examples/north/g.10.45.graphml
89
160
  - examples/north/g.10.88.graphml
90
- - examples/north/g.10.82.graphml
91
- - examples/north/g.10.27.graphml
92
- - examples/north/g.10.31.graphml
93
- - examples/north/g.10.1.graphml
94
- - examples/north/g.10.25.graphml
95
- - examples/north/g.10.71.graphml
96
- - examples/north/g.10.50.graphml
97
- - examples/north/g.12.8.graphml
98
161
  - examples/north/g.10.91.graphml
99
- - examples/north/g.10.69.graphml
100
- - examples/north/g.10.13.graphml
101
- - examples/north/g.14.9.graphml
102
- - examples/north/g.10.42.graphml
103
- - examples/north/g.10.79.graphml
104
- - examples/north/g.10.39.graphml
162
+ - examples/north/g.10.93.graphml
105
163
  - examples/north/g.10.16.graphml
106
- - examples/north/Graph.log
164
+ - examples/north/g.10.90.graphml
165
+ - examples/north/g.10.34.graphml
166
+ - examples/north/g.10.0.graphml
167
+ - examples/north/g.10.27.graphml
168
+ - examples/north/g.10.82.graphml
169
+ - examples/north/g.10.5.graphml
170
+ - examples/north/g.10.17.graphml
171
+ - examples/north/g.10.39.graphml
107
172
  - examples/north/g.10.94.graphml
173
+ - examples/north/g.10.41.graphml
174
+ - examples/north/g.10.70.graphml
108
175
  - examples/north/g.10.68.graphml
109
- - examples/north/g.10.80.graphml
110
- - examples/north/g.10.37.graphml
111
- - examples/north/g.10.61.graphml
176
+ - examples/north/g.10.72.graphml
177
+ - examples/north/g.10.86.graphml
178
+ - examples/north/g.10.79.graphml
179
+ - examples/north/g.10.85.graphml
180
+ - examples/north/g.10.42.graphml
112
181
  - examples/north/g.10.83.graphml
113
- - examples/north/g.10.5.graphml
114
- - examples/north/g.10.11.graphml
182
+ - examples/north/g.10.24.graphml
183
+ - examples/north/g.10.13.graphml
184
+ - examples/north/g.10.75.graphml
185
+ - examples/north/g.10.22.graphml
186
+ - examples/north/g.10.89.graphml
187
+ - examples/north/g.10.12.graphml
188
+ - examples/north/g.10.46.graphml
115
189
  - examples/north/g.10.40.graphml
190
+ - examples/north/g.10.3.graphml
191
+ - examples/north/g.10.80.graphml
192
+ - examples/north/g.10.11.graphml
193
+ - examples/north/g.10.57.graphml
194
+ - examples/north/g.10.69.graphml
116
195
  - examples/north/g.10.4.graphml
117
- - examples/north/g.10.90.graphml
196
+ - examples/north/g.10.78.graphml
197
+ - examples/north/g.14.9.graphml
118
198
  - examples/north/g.10.58.graphml
119
- - examples/north/g.10.15.graphml
120
- - examples/north/g.10.8.graphml
121
- - examples/north/g.10.6.graphml
122
- - examples/north/g.10.22.graphml
123
- - examples/north/g.10.9.graphml
124
- - examples/north/g.10.57.graphml
125
- - examples/north/g.10.29.graphml
126
- - examples/north/g.10.85.graphml
127
- - examples/north/g.10.70.graphml
128
- - examples/north/g.10.62.graphml
129
- - examples/north/g.10.17.graphml
130
- - examples/north/g.10.34.graphml
131
- - examples/north/g.10.56.graphml
132
- - examples/north/g.10.12.graphml
133
- - examples/north/g.10.74.graphml
134
- - examples/north/g.10.28.graphml
135
199
  - examples/north/g.10.60.graphml
136
- - examples/north/g.10.3.graphml
200
+ - examples/north/g.10.1.graphml
201
+ - examples/north/g.10.25.graphml
202
+ - examples/north/g.10.14.graphml
203
+ - examples/north/g.10.28.graphml
204
+ - examples/north/g.10.2.graphml
205
+ - examples/examples.rb
206
+ - Gemfile
207
+ - README.rdoc
208
+ - Rakefile
137
209
  - rakelib/dep_graph.rake
138
- - lib/rgl/enumerable_ext.rb
139
- - lib/rgl/transitiv_closure.rb
140
- - lib/rgl/graphxml.rb
141
- - lib/rgl/condensation.rb
142
- - lib/rgl/connected_components.rb
143
- - lib/rgl/adjacency.rb
144
- - lib/rgl/dot.rb
145
- - lib/rgl/base.rb
146
- - lib/rgl/rdot.rb
147
- - lib/rgl/mutable.rb
148
- - lib/rgl/bidirectional.rb
149
- - lib/rgl/transitivity.rb
150
- - lib/rgl/topsort.rb
151
- - lib/rgl/traversal.rb
152
- - lib/rgl/implicit.rb
153
- has_rdoc: true
154
- homepage: http://rgl.rubyforge.org
210
+ - test/dijkstra_test.rb
211
+ - test/prim_test.rb
212
+ - test/dot_test.rb
213
+ - test/graph_xml_test.rb
214
+ - test/edge_test.rb
215
+ - test/edmonds_karp_test.rb
216
+ - test/traversal_test.rb
217
+ - test/edge_properties_map_test.rb
218
+ - test/graph_test.rb
219
+ - test/undirected_graph_test.rb
220
+ - test/components_test.rb
221
+ - test/implicit_test.rb
222
+ - test/directed_graph_test.rb
223
+ - test/bellman_ford_test.rb
224
+ - test/rdot_test.rb
225
+ - test/cycles_test.rb
226
+ - test/test_helper.rb
227
+ - test/transitivity_test.rb
228
+ - test/bipartite_test.rb
229
+ homepage: https://github.com/monora/rgl
230
+ licenses: []
155
231
  post_install_message:
156
- rdoc_options:
232
+ rdoc_options:
157
233
  - --title
158
234
  - RGL - Ruby Graph Library
159
235
  - --main
160
- - README
236
+ - README.rdoc
161
237
  - --line-numbers
162
- require_paths:
238
+ require_paths:
163
239
  - lib
164
- required_ruby_version: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: "0"
169
- version:
170
- required_rubygems_version: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: "0"
175
- version:
176
- requirements:
177
- - Stream library, v0.5 or later
178
- rubyforge_project: rgl
179
- rubygems_version: 1.2.0
240
+ required_ruby_version: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ! '>='
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ segments:
247
+ - 0
248
+ hash: -105297123
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ none: false
251
+ requirements:
252
+ - - ! '>='
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
255
+ segments:
256
+ - 0
257
+ hash: -105297123
258
+ requirements: []
259
+ rubyforge_project:
260
+ rubygems_version: 1.8.23
180
261
  signing_key:
181
- specification_version: 2
262
+ specification_version: 3
182
263
  summary: Ruby Graph Library
183
264
  test_files: []
184
-
265
+ has_rdoc: true
Binary file
Binary file
data/install.rb DELETED
@@ -1,49 +0,0 @@
1
- #! /usr/bin/env ruby
2
-
3
- require 'getoptlong'
4
- require 'rbconfig'
5
- require 'ftools'
6
- require 'find'
7
-
8
- SRC_BASE = 'lib'
9
- SRC = 'rgl'
10
-
11
-
12
- INSTDIR = File.join Config::CONFIG['sitedir']
13
- DESTDIR = File.join INSTDIR, SRC
14
-
15
- opts = GetoptLong.new( [ "--uninstall", "-u", GetoptLong::NO_ARGUMENT ] )
16
-
17
- def install
18
- begin
19
- File.makedirs( DESTDIR )
20
- pwd = Dir.pwd
21
- Dir.chdir(SRC_BASE)
22
- Dir['*.rb'].each do |file|
23
- dst = File.join( INSTDIR, file )
24
- File.install(file, dst, 0644, true)
25
- end
26
- Find.find(SRC) do |file|
27
- dst = File.join( INSTDIR, file )
28
- File.install(file, dst, 0644, true) if file =~ /.rb$/
29
- end
30
- Dir.chdir(pwd)
31
- rescue
32
- puts $!
33
- end
34
- end
35
-
36
- def uninstall
37
- begin
38
- puts "Deleting:"
39
- Find.find(DESTDIR) { |file| File.rm_f file,true }
40
- Dir.delete DESTDIR
41
- rescue
42
- end
43
- end
44
-
45
- if (opt = opts.get) and opt[0] =~ /^-?-u/
46
- uninstall
47
- else
48
- install
49
- end