rgl 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +19 -10
- data/Gemfile +3 -0
- data/{README → README.rdoc} +70 -98
- data/Rakefile +44 -150
- data/examples/canvas.rb +63 -64
- data/examples/examples.rb +42 -42
- data/examples/graph.dot +46 -0
- data/examples/images/example.jpg +0 -0
- data/examples/images/module_graph.jpg +0 -0
- data/examples/images/rgl_modules.png +0 -0
- data/examples/{insel-der-tausend-gefahren.rb → insel_der_tausend_gefahren.rb} +18 -19
- data/examples/north.rb +2 -2
- data/examples/north2.rb +11 -11
- data/examples/rdep-rgl.rb +218 -222
- data/lib/rgl/adjacency.rb +78 -74
- data/lib/rgl/base.rb +160 -78
- data/lib/rgl/bellman_ford.rb +115 -0
- data/lib/rgl/bidirectional.rb +17 -10
- data/lib/rgl/bipartite.rb +87 -0
- data/lib/rgl/condensation.rb +13 -4
- data/lib/rgl/connected_components.rb +38 -30
- data/lib/rgl/dijkstra.rb +158 -0
- data/lib/rgl/dijkstra_visitor.rb +42 -0
- data/lib/rgl/dot.rb +40 -32
- data/lib/rgl/edge_properties_map.rb +55 -0
- data/lib/rgl/edmonds_karp.rb +136 -0
- data/lib/rgl/enumerable_ext.rb +4 -1
- data/lib/rgl/graph_iterator.rb +15 -0
- data/lib/rgl/graph_visitor.rb +138 -0
- data/lib/rgl/graph_wrapper.rb +15 -0
- data/lib/rgl/graphxml.rb +20 -10
- data/lib/rgl/implicit.rb +68 -66
- data/lib/rgl/mutable.rb +37 -31
- data/lib/rgl/path_builder.rb +40 -0
- data/lib/rgl/prim.rb +52 -0
- data/lib/rgl/rdot.rb +411 -374
- data/lib/rgl/topsort.rb +23 -16
- data/lib/rgl/transitivity.rb +29 -27
- data/lib/rgl/traversal.rb +67 -205
- data/rakelib/dep_graph.rake +4 -3
- data/test/bellman_ford_test.rb +187 -0
- data/test/bipartite_test.rb +47 -0
- data/test/components_test.rb +80 -0
- data/test/cycles_test.rb +60 -0
- data/test/dijkstra_test.rb +148 -0
- data/test/directed_graph_test.rb +118 -0
- data/test/dot_test.rb +26 -0
- data/test/edge_properties_map_test.rb +63 -0
- data/test/edge_test.rb +35 -0
- data/test/edmonds_karp_test.rb +105 -0
- data/{tests/TestGraph.rb → test/graph_test.rb} +6 -6
- data/test/graph_xml_test.rb +57 -0
- data/test/implicit_test.rb +53 -0
- data/test/prim_test.rb +98 -0
- data/{tests/TestRdot.rb → test/rdot_test.rb} +309 -308
- data/{tests → test}/test_helper.rb +4 -1
- data/{tests/TestTransitivity.rb → test/transitivity_test.rb} +43 -43
- data/test/traversal_test.rb +221 -0
- data/test/undirected_graph_test.rb +103 -0
- metadata +226 -145
- data/examples/example.jpg +0 -0
- data/examples/module_graph.jpg +0 -0
- data/install.rb +0 -49
- data/tests/TestComponents.rb +0 -65
- data/tests/TestCycles.rb +0 -61
- data/tests/TestDirectedGraph.rb +0 -125
- data/tests/TestDot.rb +0 -18
- data/tests/TestEdge.rb +0 -34
- data/tests/TestGraphXML.rb +0 -57
- data/tests/TestImplicit.rb +0 -52
- data/tests/TestTraversal.rb +0 -220
- 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.
|
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
|
-
|
13
|
-
|
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
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
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
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
-
|
45
|
-
-
|
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
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
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/
|
65
|
-
- examples/
|
66
|
-
- examples/
|
67
|
-
- examples/
|
68
|
-
- examples/
|
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.
|
78
|
-
- examples/north/g.10.
|
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.
|
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.
|
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/
|
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.
|
110
|
-
- examples/north/g.10.
|
111
|
-
- examples/north/g.10.
|
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.
|
114
|
-
- examples/north/g.10.
|
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.
|
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.
|
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
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
151
|
-
-
|
152
|
-
-
|
153
|
-
|
154
|
-
|
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
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
-
|
178
|
-
|
179
|
-
|
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:
|
262
|
+
specification_version: 3
|
182
263
|
summary: Ruby Graph Library
|
183
264
|
test_files: []
|
184
|
-
|
265
|
+
has_rdoc: true
|
data/examples/example.jpg
DELETED
Binary file
|
data/examples/module_graph.jpg
DELETED
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
|