rgl 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +75 -2
- data/README +52 -28
- data/Rakefile +3 -3
- data/TAGS +242 -198
- data/examples/debgraph.rb +118 -0
- data/examples/examples.rb +5 -3
- data/examples/graph.dot +731 -17
- data/examples/insel.rb +141 -0
- data/lib/rgl/adjacency.rb +172 -139
- data/lib/rgl/base.rb +247 -251
- data/lib/rgl/connected_components.rb +125 -112
- data/lib/rgl/dot.rb +54 -46
- data/lib/rgl/graphxml.rb +48 -37
- data/lib/rgl/implicit.rb +159 -136
- data/lib/rgl/mutable.rb +69 -48
- data/lib/rgl/rdot.rb +268 -205
- data/lib/rgl/topsort.rb +63 -52
- data/lib/rgl/transitiv_closure.rb +40 -28
- data/lib/rgl/traversal.rb +300 -247
- data/tests/TestDirectedGraph.rb +22 -2
- data/tests/TestUnDirectedGraph.rb +4 -0
- metadata +7 -7
- data/Makefile +0 -72
- data/examples/graph.png +0 -0
data/ChangeLog
CHANGED
@@ -1,3 +1,76 @@
|
|
1
|
+
2005-03-30 monora <monora@r40>
|
2
|
+
|
3
|
+
* tests/TestDirectedGraph.rb:
|
4
|
+
Added test for isolated vertices in DirectedGraph#reverse.
|
5
|
+
|
6
|
+
* lib/rgl/adjacency.rb:
|
7
|
+
Fixed bug in DirectedGraph#reverse reported by Kaspar Schiess. Isolated
|
8
|
+
vertices were not treated correctly.
|
9
|
+
|
10
|
+
2005-03-26 wsdng <wsdng@r40>
|
11
|
+
|
12
|
+
* lib/rgl/rdot.rb: added node and edge attributes
|
13
|
+
|
14
|
+
2005-03-22 monora <monora@r40>
|
15
|
+
|
16
|
+
* Rakefile: Fixed autorequire to work with gem version 0.8.8
|
17
|
+
|
18
|
+
2005-02-04 monora <monora@r40>
|
19
|
+
|
20
|
+
* README, lib/rgl/adjacency.rb, lib/rgl/base.rb, lib/rgl/connected_components.rb, lib/rgl/dot.rb, lib/rgl/graphxml.rb, lib/rgl/implicit.rb, lib/rgl/mutable.rb, lib/rgl/rdot.rb, lib/rgl/topsort.rb, lib/rgl/transitiv_closure.rb, lib/rgl/traversal.rb:
|
21
|
+
Fixed some formatting issues and smoothed documentation. Thanks to Rich Morin.
|
22
|
+
|
23
|
+
2004-12-13 monora <monora@r40>
|
24
|
+
|
25
|
+
* Makefile, README, Rakefile, lib/rgl/base.rb, lib/rgl/graphxml.rb, lib/rgl/implicit.rb, lib/rgl/traversal.rb:
|
26
|
+
Polished documentation
|
27
|
+
|
28
|
+
* lib/rgl/adjacency.rb, tests/TestDirectedGraph.rb, tests/TestUnDirectedGraph.rb:
|
29
|
+
Fixed bug in Graph#reverse reported by Sascha Ebach.
|
30
|
+
|
31
|
+
2004-12-12 cyent <cyent@r40>
|
32
|
+
|
33
|
+
* tests/TestGraphXML.rb: Fixed bug in relative path
|
34
|
+
|
35
|
+
* tests/TestDirectedGraph.rb: Added test_random
|
36
|
+
|
37
|
+
* lib/rgl/adjacency.rb, lib/rgl/base.rb, lib/rgl/connected_components.rb, lib/rgl/rdot.rb:
|
38
|
+
Fixed comments, removed warnings in ruby1.9 -w by adding attr_readers, told emacs to use tab-width 4 on these files
|
39
|
+
|
40
|
+
2004-12-11 monora <monora@r40>
|
41
|
+
|
42
|
+
* README, Rakefile, examples/examples.rb, lib/rgl/base.rb, lib/rgl/graphxml.rb, lib/rgl/traversal.rb, lib/stream.rb, tests/TestGraphXML.rb, tests/_TestGraphXML.rb:
|
43
|
+
Added gem packaging.
|
44
|
+
|
45
|
+
2004-10-08 monora <monora@r40>
|
46
|
+
|
47
|
+
* tests/runtests.rb: In new testframework not needed.
|
48
|
+
|
49
|
+
* lib/utils.rb: Code move to base.rb
|
50
|
+
|
51
|
+
2004-10-06 monora <monora@r40>
|
52
|
+
|
53
|
+
* lib/rgl/base.rb: Code from utils.rb included
|
54
|
+
|
55
|
+
* Rakefile: First start for gem preparation
|
56
|
+
|
57
|
+
2003-07-30 monora <monora@r40>
|
58
|
+
|
59
|
+
* lib/rgl/implicit.rb, lib/utils.rb, tests/TestComponents.rb, tests/TestDirectedGraph.rb, tests/TestImplicit.rb, tests/TestTransitiveClosure.rb, tests/TestTraversal.rb, tests/TestUnDirectedGraph.rb, tests/_TestGraphXML.rb, tests/runtests.rb:
|
60
|
+
- port to ruby 1.8
|
61
|
+
- compiler warnings removed
|
62
|
+
- set_up -> setup in testfiles
|
63
|
+
|
64
|
+
2002-11-13 monora <monora@r40>
|
65
|
+
|
66
|
+
* lib/rgl/dot.rb, lib/rgl/rdot.rb:
|
67
|
+
Name-attribute of DOTNode has to be escaped by ".
|
68
|
+
|
69
|
+
2002-11-10 monora <monora@r40>
|
70
|
+
|
71
|
+
* lib/set.rb, lib/rgl/adjacency.rb, lib/utils.rb:
|
72
|
+
Use knus compatibility library for Ruby 1.8 esp. for set.rb and inject.
|
73
|
+
|
1
74
|
2002-11-10 monora <monora@HDDESKTOP>
|
2
75
|
|
3
76
|
* lib/set.rb, lib/rgl/adjacency.rb, lib/utils.rb:
|
@@ -63,11 +136,11 @@
|
|
63
136
|
* adjacency.rb, base.rb, connected_components.rb, dot.rb, graphxml.rb, implicit.rb, mutable.rb, topsort.rb, transitiv_closure.rb:
|
64
137
|
started at sf
|
65
138
|
|
66
|
-
2002-06-10 Horst Duchene <horst
|
139
|
+
2002-06-10 Horst Duchene <horst>
|
67
140
|
|
68
141
|
* lib/rgl/graphxml.rb: added + tests + examples from graphviz catalog
|
69
142
|
|
70
|
-
2002-03-21 Horst Duchene <horst
|
143
|
+
2002-03-21 Horst Duchene <horst>
|
71
144
|
|
72
145
|
* Ported tests to Test::Unit
|
73
146
|
* transitive_closure.rb
|
data/README
CHANGED
@@ -39,13 +39,13 @@ genericity:
|
|
39
39
|
* Vertex and Edge Property Multi-Parameterization
|
40
40
|
|
41
41
|
The first is easily achieved in RGL using mixins, which of course is not as
|
42
|
-
efficient than C++ templates (but much more readable :-). The second one is
|
43
|
-
more easily implemented using standard iterators with blocks or using the
|
44
|
-
Stream module. The third one
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
machinery.
|
42
|
+
efficient than C++ templates (but much more readable :-). The second one is
|
43
|
+
even more easily implemented using standard iterators with blocks or using the
|
44
|
+
Stream[http://rgl.rubyforge.org/stream/files/README.html] module. The third one
|
45
|
+
is no issue since Ruby is dynamically typed: Each object can be a graph
|
46
|
+
vertex. There is no need for a vertex (or even edge type). In the current
|
47
|
+
version of RGL properties of vertices are simply attached using hashes. At
|
48
|
+
first there seems to be not much need for the graph property machinery.
|
49
49
|
|
50
50
|
=== Algorithms
|
51
51
|
|
@@ -87,22 +87,49 @@ http://www.boost.org/libs/graph/doc/graph_concepts.html
|
|
87
87
|
|
88
88
|
== Installation
|
89
89
|
|
90
|
-
RGL is depended on the
|
91
|
-
http://rubyforge.org/
|
90
|
+
RGL is depended on the
|
91
|
+
stream[http://rgl.rubyforge.org/stream/files/README.html] library which can
|
92
|
+
also be downloaded from http://rubyforge.org/frs/?group_id=110. If you use gem
|
93
|
+
to install RGL the stream library will be installed as a prerequisite.
|
92
94
|
|
93
95
|
=== GEM Installation
|
94
96
|
|
95
97
|
Download the GEM file and install it with ..
|
96
98
|
|
97
|
-
|
99
|
+
% gem install rgl-VERSION.gem
|
98
100
|
|
99
101
|
or directly with
|
100
102
|
|
101
|
-
|
103
|
+
% gem install rgl
|
102
104
|
|
103
105
|
Use the correct version number for VERSION (e.g. 0.2.2). You may need root
|
104
106
|
privileges to install.
|
105
107
|
|
108
|
+
=== Running tests
|
109
|
+
|
110
|
+
RGL comes with a Rakefile which automatically runs the tests. Goto the
|
111
|
+
installation directory and start rake:
|
112
|
+
|
113
|
+
% gem env
|
114
|
+
Rubygems Environment:
|
115
|
+
- VERSION: 0.8.3 (0.8.3)
|
116
|
+
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
|
117
|
+
- GEM PATH:
|
118
|
+
- /usr/lib/ruby/gems/1.8
|
119
|
+
- REMOTE SOURCES:
|
120
|
+
- http://gems.rubyforge.org
|
121
|
+
|
122
|
+
% cd /usr/lib/ruby/gems/1.8/gems/rgl-0.2.2/
|
123
|
+
% r40> rake
|
124
|
+
(in /usr/lib/ruby/gems/1.8/gems/rgl-0.2.2)
|
125
|
+
ruby1.8 -Ilib:tests -e0 -rtests/TestGraphXML -rtests/TestComponents -rtests/TestDirectedGraph -rtests/TestEdge -rtests/TestImplicit -rtests/TestTransitiveClosure -rtests/TestTraversal -rtests/TestUnDirectedGraph
|
126
|
+
Loaded suite -e
|
127
|
+
Started
|
128
|
+
........................................................................................................
|
129
|
+
Finished in 0.736444 seconds.
|
130
|
+
|
131
|
+
40 tests, 421 assertions, 0 failures, 0 errors
|
132
|
+
|
106
133
|
=== Normal Installation
|
107
134
|
|
108
135
|
You have to install stream library before. You can than install RGL with the
|
@@ -130,8 +157,8 @@ The result: link:../examples/example.jpg
|
|
130
157
|
irb> dg.has_vertex? 4
|
131
158
|
true
|
132
159
|
|
133
|
-
Every object could be a vertex (there is no class Vertex), even the class
|
134
|
-
_Object_:
|
160
|
+
Every object could be a vertex (there is no class Vertex), even the class
|
161
|
+
object _Object_:
|
135
162
|
|
136
163
|
irb> dg.has_vertex? Object
|
137
164
|
false
|
@@ -158,7 +185,7 @@ Add inverse edge (4-2) to directed graph:
|
|
158
185
|
|
159
186
|
<em>Topological sort</em> is realized with as iterator:
|
160
187
|
|
161
|
-
require 'graph/
|
188
|
+
require 'graph/topsort'
|
162
189
|
irb> dg.topsort_iterator.to_a
|
163
190
|
[1, 2, 3, 6, 4, 5]
|
164
191
|
|
@@ -178,7 +205,7 @@ A more elaborated example showing <em>implicit graphs</em>:
|
|
178
205
|
}
|
179
206
|
end
|
180
207
|
|
181
|
-
This function creates a directed graph with vertices being all loaded modules:
|
208
|
+
This function creates a directed graph, with vertices being all loaded modules:
|
182
209
|
|
183
210
|
g = module_graph
|
184
211
|
|
@@ -186,8 +213,8 @@ We only want to see the ancestors of RGL::AdjacencyGraph:
|
|
186
213
|
|
187
214
|
tree = bfs_search_tree_from(g,RGL::AdjacencyGraph)
|
188
215
|
|
189
|
-
Now we want to visualize this component of g with DOT.
|
190
|
-
subgraph of the original graph using a filtered graph:
|
216
|
+
Now we want to visualize this component of g with DOT. We therefore create a
|
217
|
+
subgraph of the original graph, using a filtered graph:
|
191
218
|
|
192
219
|
g = g.vertices_filtered_by {|v| tree.has_vertex? v}
|
193
220
|
|
@@ -208,26 +235,23 @@ graph resources. Manuel Simoni found a subtle bug in a preliminary version
|
|
208
235
|
announced at http://rubygarden.com/ruby?RubyAlgorithmPackage/Graph.
|
209
236
|
|
210
237
|
Robert kindly allowed to integrate his work on graphr, which I did not yet
|
211
|
-
succeed. Especially his work to output graphs for
|
212
|
-
http://www.research.att.com/sw/tools/graphviz/download.html
|
213
|
-
elaborated than the minimal support in dot.rb.
|
214
|
-
|
215
|
-
Jason Voegele for set.rb implementing sets using hashes. These are used in the
|
216
|
-
implementation of adjacency lists in AdjacencyGraph.
|
238
|
+
succeed. Especially his work to output graphs for
|
239
|
+
GraphViz[http://www.research.att.com/sw/tools/graphviz/download.html] is much
|
240
|
+
more elaborated than the minimal support in dot.rb.
|
217
241
|
|
218
242
|
Jeremy Siek one of the authors of the nice book "The Boost Graph Library (BGL)"
|
219
|
-
(http://
|
243
|
+
(http://www.boost.org/libs/graph/doc) kindly allowed to use the
|
220
244
|
BGL documentation as a _cheap_ reference for RGL. He and Robert also gave
|
221
245
|
feedback and many ideas for RGL.
|
222
246
|
|
223
|
-
Dave Thomas for RDoc
|
247
|
+
Dave Thomas for RDoc[http://rdoc.sourceforge.net] which generated what you read
|
224
248
|
and matz for Ruby. Dave included in the latest version of RDoc (alpha9) the
|
225
|
-
module dot/dot.rb which I use instead of Roberts module to visualize graphs
|
226
|
-
rgl/dot.rb).
|
249
|
+
module dot/dot.rb which I use instead of Roberts module to visualize graphs
|
250
|
+
(see rgl/dot.rb).
|
227
251
|
|
228
252
|
== Copying
|
229
253
|
|
230
|
-
RGL is Copyright (c) 2002,2004 by Horst Duchene. It is free software, and may be
|
254
|
+
RGL is Copyright (c) 2002,2004,2005 by Horst Duchene. It is free software, and may be
|
231
255
|
redistributed under the terms specified in the README file of the Ruby
|
232
256
|
distribution.
|
233
257
|
|
data/Rakefile
CHANGED
@@ -127,7 +127,7 @@ else
|
|
127
127
|
#### Load-time details: library and application (you will need one or both).
|
128
128
|
|
129
129
|
s.require_path = 'lib' # Use these for libraries.
|
130
|
-
s.autorequire = 'rgl'
|
130
|
+
s.autorequire = 'rgl/base'
|
131
131
|
|
132
132
|
#### Documentation and testing.
|
133
133
|
|
@@ -141,7 +141,7 @@ else
|
|
141
141
|
#### Author and project details.
|
142
142
|
s.author = "Horst Duchene"
|
143
143
|
s.email = "hd.at.clr@hduchene.de"
|
144
|
-
s.homepage = "rgl.rubyforge.org"
|
144
|
+
s.homepage = "http://rgl.rubyforge.org"
|
145
145
|
s.rubyforge_project = "rgl"
|
146
146
|
end
|
147
147
|
|
@@ -205,6 +205,6 @@ end
|
|
205
205
|
|
206
206
|
desc "Copy rdoc html to rubyforge"
|
207
207
|
task :rdoc2rf => [:rdoc] do
|
208
|
-
|
208
|
+
sh "scp -r #{RDOC_DIR} monora@rubyforge.org:/var/www/gforge-projects/rgl"
|
209
209
|
sh "scp examples/*.jpg monora@rubyforge.org:/var/www/gforge-projects/rgl/examples"
|
210
210
|
end
|
data/TAGS
CHANGED
@@ -1,209 +1,253 @@
|
|
1
1
|
|
2
|
-
lib/rgl/adjacency.rb,
|
3
|
-
module RGLRGL
|
4
|
-
class DirectedAdjacencyGraphDirectedAdjacencyGraph
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
class AdjacencyGraph < DirectedAdjacencyGraphAdjacencyGraph
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
module GraphGraph
|
21
|
-
|
22
|
-
|
23
|
-
|
2
|
+
lib/rgl/adjacency.rb,998
|
3
|
+
module RGLRGL18,633
|
4
|
+
class DirectedAdjacencyGraphDirectedAdjacencyGraph20,645
|
5
|
+
def initialize (edgelist_class = Set)initialize39,1191
|
6
|
+
def each_vertex (&b)each_vertex46,1369
|
7
|
+
def each_adjacent (v, &b) # :nodoc:each_adjacent50,1436
|
8
|
+
def directed?directed?58,1628
|
9
|
+
def has_vertex? (v)has_vertex?65,1799
|
10
|
+
def has_edge? (u, v)has_edge?75,2023
|
11
|
+
def add_vertex (v)add_vertex84,2242
|
12
|
+
def add_edge (u, v)add_edge90,2355
|
13
|
+
def remove_vertex (v)remove_vertex98,2568
|
14
|
+
def remove_edge (u, v)remove_edge108,2788
|
15
|
+
def basic_add_edge (u, v)basic_add_edge114,2901
|
16
|
+
class AdjacencyGraph < DirectedAdjacencyGraph AdjacencyGraph124,3211
|
17
|
+
def directed? # Always returns false.directed?126,3261
|
18
|
+
def remove_edge (u, v)remove_edge132,3361
|
19
|
+
def basic_add_edge (u,v)basic_add_edge139,3486
|
20
|
+
module GraphGraph146,3623
|
21
|
+
def to_adjacencyto_adjacency151,3797
|
22
|
+
def reversereverse162,4177
|
23
|
+
def to_undirectedto_undirected176,4637
|
24
24
|
|
25
|
-
lib/rgl/base.rb,
|
26
|
-
module EnumerableEnumerable
|
27
|
-
|
28
|
-
module EnumerableEnumerable
|
29
|
-
def lengthlength
|
30
|
-
module RGLRGL
|
31
|
-
class NotDirectedError < RuntimeError; endNotDirectedError
|
32
|
-
class NotUndirectedError < RuntimeError; endNotUndirectedError
|
33
|
-
class NoVertexError < IndexError; endNoVertexError
|
34
|
-
class NoEdgeError < IndexError; endNoEdgeError
|
35
|
-
module EdgeEdge
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
module GraphGraph
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
module BidirectionalGraphBidirectionalGraph
|
65
|
-
|
66
|
-
|
67
|
-
|
25
|
+
lib/rgl/base.rb,2023
|
26
|
+
module EnumerableEnumerable10,277
|
27
|
+
def inject(*argv)inject11,297
|
28
|
+
module EnumerableEnumerable39,787
|
29
|
+
def lengthlength46,979
|
30
|
+
module RGLRGL53,1050
|
31
|
+
class NotDirectedError < RuntimeError; endNotDirectedError54,1061
|
32
|
+
class NotUndirectedError < RuntimeError; endNotUndirectedError55,1106
|
33
|
+
class NoVertexError < IndexError; endNoVertexError57,1154
|
34
|
+
class NoEdgeError < IndexError; endNoEdgeError58,1194
|
35
|
+
module EdgeEdge63,1423
|
36
|
+
class DirectedEdgeDirectedEdge69,1762
|
37
|
+
def initialize (a,b)initialize78,2009
|
38
|
+
def eql?(edge)eql?84,2242
|
39
|
+
def reversereverse90,2390
|
40
|
+
def to_sto_s99,2702
|
41
|
+
def to_a; [source,target]; endto_a103,2802
|
42
|
+
class UnDirectedEdge < DirectedEdgeUnDirectedEdge113,3152
|
43
|
+
def eql?(edge)eql?114,3192
|
44
|
+
def hashhash118,3297
|
45
|
+
def to_s; "(#{source}=#{target})"; endto_s123,3407
|
46
|
+
module GraphGraph140,4274
|
47
|
+
def each_vertexeach_vertex147,4502
|
48
|
+
def each_adjacent (v)each_adjacent155,4787
|
49
|
+
def each_edge (&block)each_edge167,5315
|
50
|
+
def each(&block); each_vertex(&block); endeach180,5654
|
51
|
+
def directed?; false; enddirected?183,5762
|
52
|
+
def has_vertex?(v); include?(v); end # inherited from enumerablehas_vertex?188,6000
|
53
|
+
def empty?; num_vertices.zero?; endempty?193,6193
|
54
|
+
def vertices; to_a; endvertices196,6312
|
55
|
+
def edge_class; directed? ? DirectedEdge : UnDirectedEdge; endedge_class199,6408
|
56
|
+
def edgesedges203,6625
|
57
|
+
def adjacent_vertices (v)adjacent_vertices211,6806
|
58
|
+
def out_degree (v)out_degree219,7039
|
59
|
+
def size() # Why not in Enumerable?size226,7166
|
60
|
+
def num_vertices; size; endnum_vertices232,7330
|
61
|
+
def num_edges; r = 0; each_edge {|u,v| r +=1}; r; endnum_edges235,7398
|
62
|
+
def to_sto_s238,7537
|
63
|
+
def each_edge_auxeach_edge_aux244,7598
|
64
|
+
module BidirectionalGraphBidirectionalGraph268,8533
|
65
|
+
def each_in_neighbor (v)each_in_neighbor275,8888
|
66
|
+
def in_degree (v)in_degree282,9112
|
67
|
+
def degree (v)degree290,9356
|
68
68
|
|
69
|
-
lib/rgl/connected_components.rb,
|
70
|
-
module RGLRGL
|
71
|
-
module GraphGraph
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
69
|
+
lib/rgl/connected_components.rb,527
|
70
|
+
module RGLRGL9,261
|
71
|
+
module GraphGraph11,273
|
72
|
+
def each_connected_componenteach_connected_component23,720
|
73
|
+
class TarjanSccVisitor < DFSVisitorTarjanSccVisitor41,1322
|
74
|
+
def initialize (g)initialize47,1473
|
75
|
+
def handle_examine_vertex (v)handle_examine_vertex57,1721
|
76
|
+
def handle_finish_vertex (v)handle_finish_vertex65,1912
|
77
|
+
def num_compnum_comp85,2561
|
78
|
+
def min_discover_time (u, v)min_discover_time91,2623
|
79
|
+
def strongly_connected_componentsstrongly_connected_components129,4218
|
80
80
|
|
81
|
-
lib/rgl/dot.rb,
|
82
|
-
module RGLRGL
|
83
|
-
module GraphGraph
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
81
|
+
lib/rgl/dot.rb,309
|
82
|
+
module RGLRGL11,251
|
83
|
+
module GraphGraph13,263
|
84
|
+
def to_dot_graph (params = {})to_dot_graph19,447
|
85
|
+
def print_dotted_on (params = {}, s = $stdout)print_dotted_on40,1239
|
86
|
+
def dotty (params = {})dotty47,1453
|
87
|
+
def write_to_graphic_file (fmt='png', dotfile="graph")write_to_graphic_file58,1744
|
88
88
|
|
89
|
-
lib/rgl/graphxml.rb,
|
90
|
-
module RGLRGL
|
91
|
-
module GraphXMLGraphXML
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
89
|
+
lib/rgl/graphxml.rb,359
|
90
|
+
module RGLRGL18,614
|
91
|
+
module GraphXMLGraphXML27,905
|
92
|
+
class MutableGraphParserMutableGraphParser29,924
|
93
|
+
def initialize (graph)initialize35,1017
|
94
|
+
def tag_start (name, attrs)tag_start39,1080
|
95
|
+
def MutableGraph.append_features (includingClass)append_features50,1341
|
96
|
+
def includingClass.from_graphxml (source)from_graphxml55,1473
|
97
97
|
|
98
|
-
lib/rgl/implicit.rb,
|
99
|
-
module RGLRGL
|
100
|
-
class ImplicitGraphImplicitGraph
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
module GraphGraph
|
110
|
-
|
111
|
-
|
112
|
-
|
98
|
+
lib/rgl/implicit.rb,704
|
99
|
+
module RGLRGL23,730
|
100
|
+
class ImplicitGraphImplicitGraph25,742
|
101
|
+
def initializeinitialize39,1182
|
102
|
+
def directed?directed?48,1440
|
103
|
+
def each_vertex (&block) # :nodoc:each_vertex52,1491
|
104
|
+
def each_adjacent (v, &block) # :nodoc:each_adjacent56,1576
|
105
|
+
def each_edge (&block) # :nodoc:each_edge60,1670
|
106
|
+
def vertex_iterator (&block)vertex_iterator72,1997
|
107
|
+
def adjacent_iterator (&block)adjacent_iterator85,2365
|
108
|
+
def edge_iterator (&block)edge_iterator93,2623
|
109
|
+
module GraphGraph100,2723
|
110
|
+
def vertices_filtered_by (&filter)vertices_filtered_by126,3533
|
111
|
+
def edges_filtered_by (&filter)edges_filtered_by146,4175
|
112
|
+
def implicit_graphimplicit_graph163,4698
|
113
113
|
|
114
|
-
lib/rgl/mutable.rb,
|
115
|
-
module RGLRGL
|
116
|
-
module MutableGraphMutableGraph
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
lib/rgl/mutable.rb,382
|
115
|
+
module RGLRGL5,34
|
116
|
+
module MutableGraphMutableGraph10,137
|
117
|
+
def add_vertex (v)add_vertex17,310
|
118
|
+
def add_edge (u, v)add_edge29,770
|
119
|
+
def add_vertices (*a)add_vertices35,884
|
120
|
+
def add_edges (*edges)add_edges43,1127
|
121
|
+
def remove_vertex (v)remove_vertex53,1512
|
122
|
+
def remove_edge (u, v)remove_edge63,1831
|
123
|
+
def remove_vertices (*a)remove_vertices70,1998
|
124
124
|
|
125
|
-
lib/rgl/rdot.rb,
|
126
|
-
module DOTDOT
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
125
|
+
lib/rgl/rdot.rb,1493
|
126
|
+
module DOTDOT10,254
|
127
|
+
def change_tab (t)change_tab19,428
|
128
|
+
class DOTSimpleElementDOTSimpleElement118,4745
|
129
|
+
def initialize (params = {})initialize122,4796
|
130
|
+
def to_sto_s126,4890
|
131
|
+
class DOTElement < DOTSimpleElementDOTElement133,4992
|
132
|
+
def initialize (params = {}, option_list = [])initialize138,5092
|
133
|
+
def each_optioneach_option149,5451
|
134
|
+
def each_option_paireach_option_pair153,5515
|
135
|
+
class DOTPort < DOTSimpleElementDOTPort168,5840
|
136
|
+
def initialize (params = {})initialize172,5910
|
137
|
+
def to_sto_s177,6025
|
138
|
+
class DOTNode < DOTElementDOTNode184,6140
|
139
|
+
def initialize (params = {}, option_list = NODE_OPTS)initialize188,6182
|
140
|
+
def each_porteach_port193,6336
|
141
|
+
def push (thing)push201,6447
|
142
|
+
def poppop205,6502
|
143
|
+
def to_s (t = '')to_s209,6540
|
144
|
+
class DOTSubgraph < DOTElementDOTSubgraph238,7531
|
145
|
+
def initialize (params = {}, option_list = GRAPH_OPTS)initialize243,7593
|
146
|
+
def each_nodeeach_node249,7781
|
147
|
+
def push (thing)push257,7898
|
148
|
+
def poppop261,7955
|
149
|
+
def to_s (t = '')to_s265,7993
|
150
|
+
class DOTDigraph < DOTSubgraphDOTDigraph284,8473
|
151
|
+
def initialize (params = {}, option_list = GRAPH_OPTS)initialize286,8507
|
152
|
+
class DOTEdge < DOTElementDOTEdge295,8687
|
153
|
+
def initialize (params = {}, option_list = EDGE_OPTS)initialize299,8747
|
154
|
+
def edge_linkedge_link305,8954
|
155
|
+
def to_s (t = '')to_s309,8992
|
156
|
+
class DOTDirectedEdge < DOTEdgeDOTDirectedEdge320,9341
|
157
|
+
def edge_linkedge_link322,9376
|
158
158
|
|
159
|
-
lib/rgl/topsort.rb,
|
160
|
-
module RGLRGL
|
161
|
-
class TopsortIteratorTopsortIterator
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
module GraphGraph
|
168
|
-
|
169
|
-
|
159
|
+
lib/rgl/topsort.rb,484
|
160
|
+
module RGLRGL5,39
|
161
|
+
class TopsortIteratorTopsortIterator17,521
|
162
|
+
def initialize (g)initialize21,573
|
163
|
+
def set_to_begin # :nodoc:set_to_begin26,639
|
164
|
+
def basic_forward # :nodoc:basic_forward42,1017
|
165
|
+
def at_beginning?; true; end # :nodoc: FIXMEat_beginning?51,1213
|
166
|
+
def at_end?; @waiting.empty?; end # :nodoc:at_end?52,1273
|
167
|
+
module GraphGraph56,1360
|
168
|
+
def topsort_iteratortopsort_iterator60,1410
|
169
|
+
def acyclic?acyclic?67,1627
|
170
170
|
|
171
|
-
lib/rgl/transitiv_closure.rb,
|
172
|
-
module RGLRGL
|
173
|
-
module GraphGraph
|
174
|
-
|
171
|
+
lib/rgl/transitiv_closure.rb,131
|
172
|
+
module RGLRGL12,362
|
173
|
+
module GraphGraph14,374
|
174
|
+
def transitive_closure_floyd_warshaltransitive_closure_floyd_warshal23,721
|
175
175
|
|
176
|
-
lib/rgl/traversal.rb,
|
177
|
-
module RGLRGL
|
178
|
-
module GraphWrapper
|
179
|
-
|
180
|
-
module GraphIteratorGraphIterator
|
181
|
-
module GraphVisitorGraphVisitor
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
class BFSIteratorBFSIterator
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
module GraphGraph
|
200
|
-
|
201
|
-
|
202
|
-
class DFSIterator < BFSIteratorDFSIterator
|
203
|
-
|
204
|
-
class DFSVisitorDFSVisitor
|
205
|
-
module GraphGraph
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
def acyclic?acyclic?
|
176
|
+
lib/rgl/traversal.rb,1779
|
177
|
+
module RGLRGL16,593
|
178
|
+
module GraphWrapper # :nodoc:GraphWrapper18,605
|
179
|
+
def initialize (graph)initialize23,743
|
180
|
+
module GraphIteratorGraphIterator31,1009
|
181
|
+
module GraphVisitorGraphVisitor66,2413
|
182
|
+
def initialize (graph)initialize74,2535
|
183
|
+
def resetreset81,2649
|
184
|
+
def finished_vertex? (v)finished_vertex?87,2777
|
185
|
+
def attach_distance_map (map = Hash.new(0))attach_distance_map100,3220
|
186
|
+
def handle_tree_edge (u, v)handle_tree_edge105,3312
|
187
|
+
def distance_to_root (v)distance_to_root112,3471
|
188
|
+
def follow_edge? (u, v) # :nodoc:follow_edge?121,3630
|
189
|
+
def self.def_event_handler (m)def_event_handler127,3740
|
190
|
+
def handle_#{m} (#{params})handle_130,3841
|
191
|
+
def set_#{m}_event_handler (&b)set_134,3968
|
192
|
+
class BFSIteratorBFSIterator160,4865
|
193
|
+
def initialize (graph, start=graph.detect{ |x| true })initialize169,5043
|
194
|
+
def at_beginning? # :nodoc:at_beginning?177,5258
|
195
|
+
def at_end?at_end?183,5379
|
196
|
+
def set_to_beginset_to_begin189,5503
|
197
|
+
def basic_forward # :nodoc:basic_forward195,5685
|
198
|
+
def next_vertex # :nodoc:next_vertex219,6414
|
199
|
+
module GraphGraph226,6532
|
200
|
+
def bfs_iterator (v = self.detect { |x| true})bfs_iterator230,6602
|
201
|
+
def bfs_search_tree_from (v)bfs_search_tree_from238,6910
|
202
|
+
class DFSIterator < BFSIteratorDFSIterator258,7523
|
203
|
+
def next_vertexnext_vertex260,7558
|
204
|
+
class DFSVisitorDFSVisitor279,8231
|
205
|
+
module GraphGraph288,8357
|
206
|
+
def dfs_iterator (v = self.detect { |x| true })dfs_iterator292,8425
|
207
|
+
def depth_first_search (vis = DFSVisitor.new(self), &b)depth_first_search300,8706
|
208
|
+
def depth_first_visit (u, vis = DFSVisitor.new(self), &b)depth_first_visit312,9047
|
209
|
+
def acyclic?acyclic?337,9940
|
210
|
+
|
211
|
+
lib/rgl/xx.rb,1766
|
212
|
+
module EnumerableEnumerable15,316
|
213
|
+
def inject (*argv)inject17,337
|
214
|
+
module EnumerableEnumerable47,910
|
215
|
+
def lengthlength56,1106
|
216
|
+
module RGLRGL65,1200
|
217
|
+
class NotDirectedError < RuntimeError; end NotDirectedError67,1212
|
218
|
+
class NotUndirectedError < RuntimeError; end NotUndirectedError68,1261
|
219
|
+
class NoVertexError < IndexError; end NoVertexError69,1310
|
220
|
+
class NoEdgeError < IndexError; endNoEdgeError70,1359
|
221
|
+
module EdgeEdge76,1600
|
222
|
+
class DirectedEdgeDirectedEdge84,1940
|
223
|
+
def initialize (a, b)initialize96,2192
|
224
|
+
def eql? (edge)eql?104,2441
|
225
|
+
def reversereverse112,2592
|
226
|
+
def to_sto_s125,2921
|
227
|
+
def to_ato_a131,3024
|
228
|
+
class UnDirectedEdge < DirectedEdgeUnDirectedEdge146,3378
|
229
|
+
def eql? (edge)eql?148,3419
|
230
|
+
def hashhash152,3529
|
231
|
+
def to_sto_s158,3644
|
232
|
+
module GraphGraph181,4544
|
233
|
+
def each_vertexeach_vertex190,4775
|
234
|
+
def each_adjacent (v)each_adjacent199,5049
|
235
|
+
def each_edge (&block)each_edge212,5565
|
236
|
+
def each (&block)each226,5916
|
237
|
+
def directed?directed?232,6039
|
238
|
+
def has_vertex? (v)has_vertex?240,6291
|
239
|
+
def empty?empty?248,6495
|
240
|
+
def verticesvertices254,6625
|
241
|
+
def edge_classedge_class260,6730
|
242
|
+
def edgesedges267,6956
|
243
|
+
def adjacent_vertices (v)adjacent_vertices276,7143
|
244
|
+
def out_degree (v)out_degree285,7379
|
245
|
+
def size # Why not in Enumerable?size293,7508
|
246
|
+
def num_verticesnum_vertices303,7716
|
247
|
+
def num_edgesnum_edges309,7793
|
248
|
+
def to_sto_s317,7954
|
249
|
+
def each_edge_auxeach_edge_aux323,8019
|
250
|
+
module BidirectionalGraphBidirectionalGraph349,8937
|
251
|
+
def each_in_neighbor (v)each_in_neighbor359,9301
|
252
|
+
def in_degree (v)in_degree367,9530
|
253
|
+
def degree (v)degree376,9775
|