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 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@hduchene.de>
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@hduchene.de>
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 even
43
- more easily implemented using standard iterators with blocks or using the
44
- Stream module. The third one is no issue since Ruby is dynamically typed: Each
45
- object can be a graph vertex. There is no need for a vertex (or even edge
46
- type). In the current version of RGL properties of vertices are simply attached
47
- using hashes. At first there seems to be not much need for the graph property
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 _stream_ library which can also be downloaded from
91
- http://rubyforge.org/frs/?group_id=110.
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
- gem install rgl-VERSION.gem
99
+ % gem install rgl-VERSION.gem
98
100
 
99
101
  or directly with
100
102
 
101
- gem install rgl
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 object
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/traversal'
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. We therefore create a
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 GraphViz (see
212
- http://www.research.att.com/sw/tools/graphviz/download.html) is much more
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://cseng.awl.com/book/0,3828,0201729148,00.html) kindly allowed to use the
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 (http://rdoc.sourceforge.net) which generated what you read
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 (see
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
- #sh "scp -r #{RDOC_DIR} monora@rubyforge.org:/var/www/gforge-projects/rgl"
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,956
3
- module RGLRGL16,586
4
- class DirectedAdjacencyGraphDirectedAdjacencyGraph17,597
5
- def initialize(edgelist_class=Set)initialize33,1091
6
- def each_vertex(&b)each_vertex39,1248
7
- def each_adjacent(v, &b) # :nodoc:each_adjacent43,1305
8
- def directed?; true; enddirected?49,1470
9
- def has_vertex?(v); @vertice_dict.has_key?(v); endhas_vertex?53,1619
10
- def has_edge? (u, v)has_edge?60,1799
11
- def add_vertex(v)add_vertex67,1981
12
- def add_edge (u,v)add_edge72,2080
13
- def remove_vertex(v)remove_vertex79,2230
14
- def remove_edge (u,v)remove_edge87,2422
15
- def basic_add_edge(u,v)basic_add_edge93,2522
16
- class AdjacencyGraph < DirectedAdjacencyGraphAdjacencyGraph101,2812
17
- def directed?; false; enddirected?103,2885
18
- def remove_edge (u,v)remove_edge106,2936
19
- def basic_add_edge(u,v)basic_add_edge112,3044
20
- module GraphGraph119,3143
21
- def to_adjacencyto_adjacency122,3291
22
- def reversereverse132,3639
23
- def to_undirectedto_undirected144,4009
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,1907
26
- module EnumerableEnumerable12,301
27
- def inject(*argv)inject13,321
28
- module EnumerableEnumerable41,700
29
- def lengthlength48,892
30
- module RGLRGL55,954
31
- class NotDirectedError < RuntimeError; endNotDirectedError56,965
32
- class NotUndirectedError < RuntimeError; endNotUndirectedError57,1010
33
- class NoVertexError < IndexError; endNoVertexError59,1058
34
- class NoEdgeError < IndexError; endNoEdgeError60,1098
35
- module EdgeEdge65,1327
36
- class DirectedEdgeDirectedEdge71,1651
37
- def initialize (a,b)initialize80,1874
38
- def eql?(edge)eql?86,2086
39
- def reversereverse92,2216
40
- def to_sto_s101,2504
41
- def to_a; [source,target]; endto_a105,2589
42
- class UnDirectedEdge < DirectedEdgeUnDirectedEdge115,2894
43
- def eql?(edge)eql?116,2931
44
- def hashhash120,3021
45
- def to_s; "(#{source}=#{target})"; endto_s125,3113
46
- module GraphGraph144,3938
47
- def each_vertexeach_vertex151,4151
48
- def each_adjacent (v)each_adjacent159,4401
49
- def each_edge (&block)each_edge171,4882
50
- def each(&block); each_vertex(&block); endeach184,5165
51
- def directed?; false; enddirected?187,5264
52
- def has_vertex?(v); include?(v); end # inherited from enumerablehas_vertex?192,5490
53
- def empty?; num_vertices.zero?; endempty?197,5668
54
- def vertices; to_a; endvertices200,5781
55
- def edge_class; directed? ? DirectedEdge : UnDirectedEdge; endedge_class203,5871
56
- def edgesedges207,6079
57
- def adjacent_vertices (v)adjacent_vertices215,6239
58
- def out_degree (v)out_degree223,6451
59
- def size # Why not in Enumerable?size230,6560
60
- def num_vertices; size; endnum_vertices236,6732
61
- def num_edges; r = 0; each_edge {|u,v| r +=1}; r; endnum_edges239,6794
62
- def to_sto_s242,6927
63
- def each_edge_auxeach_edge_aux248,6973
64
- module BidirectionalGraphBidirectionalGraph272,7816
65
- def each_in_neighbor (v)each_in_neighbor279,8156
66
- def in_degree (v)in_degree286,8359
67
- def degree (v)degree294,8582
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,497
70
- module RGLRGL7,233
71
- module GraphGraph8,244
72
- def each_connected_componenteach_connected_component17,641
73
- class TarjanSccVisitor < DFSVisitorTarjanSccVisitor34,1174
74
- def initialize(g)initialize38,1314
75
- def handle_examine_vertex(v)handle_examine_vertex48,1458
76
- def handle_finish_vertex(v)handle_finish_vertex56,1606
77
- def num_compnum_comp75,2151
78
- def min_discover_time(u,v)min_discover_time81,2198
79
- def strongly_connected_componentsstrongly_connected_components118,3687
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,298
82
- module RGLRGL10,239
83
- module GraphGraph11,250
84
- def to_dot_graph( params = {} )to_dot_graph15,428
85
- def print_dotted_on (params = {}, s=$stdout)print_dotted_on35,1076
86
- def dotty( params = {} )dotty41,1270
87
- def write_to_graphic_file(fmt='png', dotfile="graph")write_to_graphic_file51,1530
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,340
90
- module RGLRGL15,594
91
- module GraphXMLGraphXML22,893
92
- class MutableGraphParserMutableGraphParser23,911
93
- def initialize(graph)initialize26,992
94
- def tag_start(name, attrs)tag_start30,1042
95
- def MutableGraph.append_features(includingClass)append_features41,1229
96
- def includingClass.from_graphxml (source)from_graphxml45,1350
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,681
99
- module RGLRGL19,702
100
- class ImplicitGraphImplicitGraph20,713
101
- def initializeinitialize32,1102
102
- def directed?; @directed; enddirected?40,1337
103
- def each_vertex (&block) # :nodoc:each_vertex42,1370
104
- def each_adjacent (v, &block) # :nodoc:each_adjacent46,1444
105
- def each_edge (&block) # :nodoc:each_edge50,1527
106
- def vertex_iterator (&block)vertex_iterator60,1811
107
- def adjacent_iterator (&block)adjacent_iterator69,2127
108
- def edge_iterator (&block)edge_iterator76,2367
109
- module GraphGraph81,2433
110
- def vertices_filtered_by (&filter)vertices_filtered_by105,3129
111
- def edges_filtered_by (&filter)edges_filtered_by124,3675
112
- def implicit_graphimplicit_graph141,4120
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,484
115
- module RGLRGL3,20
116
- module MutableGraphMutableGraph6,121
117
- def add_vertex(v); raise NotImplementedError; endadd_vertex11,266
118
- def add_edge(u, v); raise NotImplementedError; endadd_edge20,692
119
- def add_vertices (*a)add_vertices23,790
120
- def add_edges (*edges)add_edges30,1010
121
- def remove_vertex(v); raise NotImplementedError; endremove_vertex39,1365
122
- def remove_edge(u, v); raise NotImplementedError; endremove_edge46,1653
123
- def remove_vertices (*a)remove_vertices50,1798
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,1615
126
- module DOTDOT9,242
127
- def change_tab( t )change_tab16,420
128
- class DOTSimpleElementDOTSimpleElement81,1613
129
- def initialize( params = {} )initialize84,1669
130
- def to_sto_s88,1778
131
- class DOTElement < DOTSimpleElementDOTElement94,1897
132
- def initialize( params = {}, option_list = [] )initialize98,2005
133
- def each_optioneach_option109,2419
134
- def each_option_paireach_option_pair113,2497
135
- class DOTPort < DOTSimpleElementDOTPort126,2856
136
- def initialize( params = {} )initialize129,2931
137
- def to_sto_s133,3068
138
- class DOTNode < DOTElementDOTNode139,3200
139
- def initialize( params = {}, option_list = NODE_OPTS )initialize142,3247
140
- def each_porteach_port147,3424
141
- def push ( thing )push155,3564
142
- def poppop159,3637
143
- def to_s( t = '' )to_s163,3689
144
- class DOTSubgraph < DOTElementDOTSubgraph188,4604
145
- def initialize( params = {}, option_list = GRAPH_OPTS )initialize192,4675
146
- def each_nodeeach_node198,4887
147
- def push( thing )push206,5034
148
- def poppop210,5106
149
- def to_s( t = '' )to_s214,5158
150
- class DOTDigraph < DOTSubgraphDOTDigraph231,5663
151
- def initialize( params = {}, option_list = GRAPH_OPTS )initialize232,5698
152
- class DOTEdge < DOTElementDOTEdge239,5879
153
- def initialize( params = {}, option_list = EDGE_OPTS )initialize241,5943
154
- def edge_link; '--'; endedge_link247,6177
155
- def to_s( t = '' )to_s248,6204
156
- class DOTDirectedEdge < DOTEdgeDOTDirectedEdge258,6557
157
- def edge_link; '->'; endedge_link259,6590
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,447
160
- module RGLRGL3,25
161
- class TopsortIteratorTopsortIterator14,503
162
- def initialize(g)initialize16,550
163
- def set_to_begin # :nodoc:set_to_begin21,602
164
- def basic_forward # :nodoc:basic_forward36,924
165
- def at_beginning?; true; end # :nodoc: FIXMEat_beginning?45,1091
166
- def at_end?; @waiting.empty?; end # :nodoc:at_end?46,1138
167
- module GraphGraph49,1190
168
- def topsort_iteratortopsort_iterator51,1235
169
- def acyclic?acyclic?57,1425
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,127
172
- module RGLRGL9,334
173
- module GraphGraph10,345
174
- def transitive_closure_floyd_warshaltransitive_closure_floyd_warshal16,665
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,1708
177
- module RGLRGL14,546
178
- module GraphWrapper # :nodoc:GraphWrapper15,557
179
- def initialize(graph); @graph = graph; endinitialize19,658
180
- module GraphIteratorGraphIterator24,863
181
- module GraphVisitorGraphVisitor59,2225
182
- def initialize(graph)initialize64,2335
183
- def resetreset70,2432
184
- def finished_vertex? vfinished_vertex?75,2546
185
- def attach_distance_map(map=Hash.new(0))attach_distance_map87,2937
186
- def handle_tree_edge(u,v)handle_tree_edge90,3015
187
- def distance_to_root(v)distance_to_root96,3141
188
- def follow_edge?(u,v) # :nodoc:follow_edge?103,3261
189
- def self.def_event_handler(m)def_event_handler108,3355
190
- def handle_#{m}(#{params})handle_111,3446
191
- def set_#{m}_event_handler(&b)set_114,3553
192
- class BFSIteratorBFSIterator137,4373
193
- def initialize(graph, start=graph.detect{|x| true})initialize143,4535
194
- def at_beginning?; @color_map.size == 1; end # :nodoc:at_beginning?150,4727
195
- def at_end?; @waiting.empty?; endat_end?153,4823
196
- def set_to_beginset_to_begin156,4932
197
- def basic_forward # :nodoc:basic_forward162,5098
198
- def next_vertex () # :nodoc:next_vertex186,5696
199
- module GraphGraph192,5804
200
- def bfs_iterator (v=self.detect {|x| true})bfs_iterator194,5867
201
- def bfs_search_tree_from(v)bfs_search_tree_from201,6151
202
- class DFSIterator < BFSIteratorDFSIterator218,6699
203
- def next_vertexnext_vertex219,6733
204
- class DFSVisitorDFSVisitor235,7372
205
- module GraphGraph241,7469
206
- def dfs_iterator (v=self.detect {|x| true})dfs_iterator243,7532
207
- def depth_first_search (vis = DFSVisitor.new(self),&b)depth_first_search250,7787
208
- def depth_first_visit (u, vis = DFSVisitor.new(self), &b)depth_first_visit261,8079
209
- def acyclic?acyclic?285,8775
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