rgl 0.5.8 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +7 -2
  3. data/README.md +30 -39
  4. data/examples/canvas.rb +1 -1
  5. data/examples/graph.dot +971 -0
  6. data/examples/insel_der_tausend_gefahren.rb +1 -1
  7. data/examples/north/g.10.0.graphml +1 -1
  8. data/examples/north/g.10.1.graphml +1 -1
  9. data/examples/north/g.10.11.graphml +1 -1
  10. data/examples/north/g.10.12.graphml +1 -1
  11. data/examples/north/g.10.13.graphml +1 -1
  12. data/examples/north/g.10.14.graphml +1 -1
  13. data/examples/north/g.10.15.graphml +1 -1
  14. data/examples/north/g.10.16.graphml +1 -1
  15. data/examples/north/g.10.17.graphml +1 -1
  16. data/examples/north/g.10.19.graphml +1 -1
  17. data/examples/north/g.10.2.graphml +1 -1
  18. data/examples/north/g.10.20.graphml +1 -1
  19. data/examples/north/g.10.22.graphml +1 -1
  20. data/examples/north/g.10.24.graphml +1 -1
  21. data/examples/north/g.10.25.graphml +1 -1
  22. data/examples/north/g.10.27.graphml +1 -1
  23. data/examples/north/g.10.28.graphml +1 -1
  24. data/examples/north/g.10.29.graphml +1 -1
  25. data/examples/north/g.10.3.graphml +1 -1
  26. data/examples/north/g.10.30.graphml +1 -1
  27. data/examples/north/g.10.31.graphml +1 -1
  28. data/examples/north/g.10.34.graphml +1 -1
  29. data/examples/north/g.10.37.graphml +1 -1
  30. data/examples/north/g.10.38.graphml +1 -1
  31. data/examples/north/g.10.39.graphml +1 -1
  32. data/examples/north/g.10.4.graphml +1 -1
  33. data/examples/north/g.10.40.graphml +1 -1
  34. data/examples/north/g.10.41.graphml +1 -1
  35. data/examples/north/g.10.42.graphml +1 -1
  36. data/examples/north/g.10.45.graphml +1 -1
  37. data/examples/north/g.10.46.graphml +1 -1
  38. data/examples/north/g.10.5.graphml +1 -1
  39. data/examples/north/g.10.50.graphml +1 -1
  40. data/examples/north/g.10.56.graphml +1 -1
  41. data/examples/north/g.10.57.graphml +1 -1
  42. data/examples/north/g.10.58.graphml +1 -1
  43. data/examples/north/g.10.6.graphml +1 -1
  44. data/examples/north/g.10.60.graphml +1 -1
  45. data/examples/north/g.10.61.graphml +1 -1
  46. data/examples/north/g.10.62.graphml +1 -1
  47. data/examples/north/g.10.68.graphml +1 -1
  48. data/examples/north/g.10.69.graphml +1 -1
  49. data/examples/north/g.10.7.graphml +1 -1
  50. data/examples/north/g.10.70.graphml +1 -1
  51. data/examples/north/g.10.71.graphml +1 -1
  52. data/examples/north/g.10.72.graphml +1 -1
  53. data/examples/north/g.10.74.graphml +1 -1
  54. data/examples/north/g.10.75.graphml +1 -1
  55. data/examples/north/g.10.78.graphml +1 -1
  56. data/examples/north/g.10.79.graphml +1 -1
  57. data/examples/north/g.10.8.graphml +1 -1
  58. data/examples/north/g.10.80.graphml +1 -1
  59. data/examples/north/g.10.82.graphml +1 -1
  60. data/examples/north/g.10.83.graphml +1 -1
  61. data/examples/north/g.10.85.graphml +1 -1
  62. data/examples/north/g.10.86.graphml +1 -1
  63. data/examples/north/g.10.88.graphml +1 -1
  64. data/examples/north/g.10.89.graphml +1 -1
  65. data/examples/north/g.10.9.graphml +1 -1
  66. data/examples/north/g.10.90.graphml +1 -1
  67. data/examples/north/g.10.91.graphml +1 -1
  68. data/examples/north/g.10.92.graphml +1 -1
  69. data/examples/north/g.10.93.graphml +1 -1
  70. data/examples/north/g.10.94.graphml +1 -1
  71. data/examples/north/g.12.8.graphml +1 -1
  72. data/examples/north/g.14.9.graphml +1 -1
  73. data/examples/north.rb +1 -1
  74. data/examples/rdep-rgl.rb +3 -3
  75. data/lib/rgl/adjacency.rb +43 -51
  76. data/lib/rgl/base.rb +71 -60
  77. data/lib/rgl/bellman_ford.rb +4 -5
  78. data/lib/rgl/bidirectional.rb +2 -2
  79. data/lib/rgl/bipartite.rb +1 -1
  80. data/lib/rgl/condensation.rb +3 -3
  81. data/lib/rgl/connected_components.rb +6 -6
  82. data/lib/rgl/dijkstra.rb +2 -2
  83. data/lib/rgl/dot.rb +5 -7
  84. data/lib/rgl/edmonds_karp.rb +7 -2
  85. data/lib/rgl/graph_iterator.rb +4 -2
  86. data/lib/rgl/graph_visitor.rb +16 -14
  87. data/lib/rgl/graph_wrapper.rb +3 -2
  88. data/lib/rgl/graphxml.rb +4 -4
  89. data/lib/rgl/implicit.rb +35 -35
  90. data/lib/rgl/mutable.rb +7 -7
  91. data/lib/rgl/path_builder.rb +3 -2
  92. data/lib/rgl/prim.rb +3 -1
  93. data/lib/rgl/rdot.rb +7 -7
  94. data/lib/rgl/topsort.rb +8 -7
  95. data/lib/rgl/transitivity.rb +6 -6
  96. data/lib/rgl/traversal.rb +47 -47
  97. data/test/traversal_test.rb +1 -1
  98. metadata +9 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43739f63914a8070716c45a94f95c058b75efee0f4cd478a30d1cdc0e45e30c0
4
- data.tar.gz: 44d66025f8ca816c618eb12ac4a7fee1fa315c4312af698909e87caa0bdb48ad
3
+ metadata.gz: dc32ab84139b87296c8e71d490843c6d90c83257e7876f42f25b23d0ae852cd8
4
+ data.tar.gz: 44177136283480e8ba77c431343d7a6361d3ac79e58b1d5864d8a74556ca4bd6
5
5
  SHA512:
6
- metadata.gz: e910d7b6fdaaab9873f5daac67009eab91681789372e00e9d0bdbbfa09782f4b67763ce09634245cf0c07325847c5ec90695323dec65aaa6d940d775a89447a8
7
- data.tar.gz: bfcd42c97cc6361e58145aa3bf5f97c89d3e9b9d1a290f67a4ffb52e0829f9f0aff06c4d17a4d0ed1f83997e0917a1fbd11cdf340a6967fc7e8cfa3ad6dc6118
6
+ metadata.gz: 51c96d180f5d570bfcaeaf5653749bf432fbcb3a82e75336f7883c0e45bc48de0d20e2ce6b26238fc9678bc0449e8564d7c1902f1dbd7101f6680d4481847850
7
+ data.tar.gz: eb9dcbd3b6ee1d870c2a2afeaab045bc29107ef5b9fc1b9fa2dc356ca5961a87c0bcf8d7d32dca2fb5add0e466598bc167128a4fbebc6f4428970439adfcd02d
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2022-08 Release 0.5.9
2
+
3
+ Dan Čermák
4
+ * Drop lazy priority queue (#64) (3b1db1)
5
+
1
6
  2022-06 Release 0.5.8
2
7
 
3
8
  Horst Duchene
@@ -232,8 +237,8 @@ This release mainly contains the contributions of Kirill, who added many algorit
232
237
  tests/TestRdot.rb: All IDs for DOT objects, including names,
233
238
  options, and values, are now automatically quoted as necessary
234
239
  according to the rules documented at
235
- http://www.graphviz.org/doc/info/lang.html and
236
- http://www.graphviz.org/Documentation/dotguide.pdf.
240
+ https://www.graphviz.org/doc/info/lang.html and
241
+ https://www.graphviz.org/Documentation/dotguide.pdf.
237
242
 
238
243
  Labels are handled specially in order to account for \l, \r, and
239
244
  \n sequences but are otherwise treated the same as other options.
data/README.md CHANGED
@@ -1,22 +1,21 @@
1
- # Ruby Graph Library (RGL) [![test](https://github.com/monora/rgl/actions/workflows/ruby.yml/badge.svg)](https://github.com/monora/rgl/actions/workflows/ruby.yml) [<img src="https://codeclimate.com/github/monora/rgl/badges/coverage.svg" />](https://codeclimate.com/github/monora/rgl/coverage) [<img src="https://badge.fury.io/rb/rgl.svg" alt="Version"/>](https://badge.fury.io/rb/rgl) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/monora/rgl)
1
+ # Ruby Graph Library (RGL)[![Test](https://github.com/monora/rgl/actions/workflows/test.yml/badge.svg)](https://github.com/monora/rgl/actions/workflows/test.yml) [![Doc](https://github.com/monora/rgl/actions/workflows/doc.yml/badge.svg)](https://github.com/monora/rgl/actions/workflows/doc.yml) [<img src="https://codeclimate.com/github/monora/rgl/badges/coverage.svg" />](https://codeclimate.com/github/monora/rgl/coverage) [<img src="https://badge.fury.io/rb/rgl.svg" alt="Version"/>](https://badge.fury.io/rb/rgl) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/monora/rgl)
2
2
 
3
3
  RGL is a framework for graph data structures and algorithms.
4
4
 
5
5
  The design of the library is much influenced by the Boost Graph Library (BGL)
6
- which is written in C++. Refer to http://www.boost.org/libs/graph/doc for
6
+ which is written in C++. Refer to https://www.boost.org/libs/graph/doc for
7
7
  further links and documentation on graph data structures and algorithms and
8
8
  the design rationales of BGL.
9
9
 
10
10
  A comprehensive summary of graph terminology can be found in the graph section
11
11
  of the *Dictionary of Algorithms and Data Structures* at
12
- http://www.nist.gov/dads/HTML/graph.html or
12
+ https://www.nist.gov/dads/HTML/graph.html or
13
13
  [Wikipedia](https://en.wikipedia.org/wiki/Graph_%28discrete_mathematics%29).
14
14
 
15
- ## Documentation
16
-
17
- * RGL's [API Reference](http://www.rubydoc.info/github/monora/rgl) at
18
- http://rubydoc.info
19
-
15
+ * [GitHub Repository](https://github.com/monora/rgl)
16
+ * [API Reference](https://monora.github.io/rgl/) generated from master branch
17
+ * [API Reference](https://www.rubydoc.info/github/monora/rgl) at
18
+ https://rubydoc.info for the latest release
20
19
 
21
20
  ## Design principles
22
21
 
@@ -31,7 +30,6 @@ Ruby. The main design goals directly taken from the BGL design are:
31
30
  * A standardized generic interface for traversing graphs
32
31
  {RGL::GraphIterator}
33
32
 
34
-
35
33
  RGL provides some general purpose graph classes that conform to this
36
34
  interface, but they are not meant to be the **only** graph classes. As in BGL
37
35
  I believe that the main contribution of the RGL is the formulation of this
@@ -48,11 +46,10 @@ achieve genericity:
48
46
  * Element Type Parameterization
49
47
  * Vertex and Edge Property Multi-Parameterization
50
48
 
51
-
52
49
  The first is easily achieved in RGL using mixins, which of course is not as
53
50
  efficient than C++ templates (but much more readable :-). The second one is
54
51
  even more easily implemented using standard iterators with blocks or using the
55
- [stream](http://www.rubydoc.info/github/monora/stream) module. The third one
52
+ [stream](https://www.rubydoc.info/github/monora/stream) module. The third one
56
53
  is no issue since Ruby is dynamically typed: Each object can be a graph
57
54
  vertex. There is no need for a vertex (or even edge type). In the current
58
55
  version of RGL properties of vertices are simply attached using hashes. At
@@ -65,7 +62,6 @@ RGL current contains a core set of algorithm patterns:
65
62
  * Breadth First Search {RGL::BFSIterator}
66
63
  * Depth First Search {RGL::DFSIterator}
67
64
 
68
-
69
65
  The algorithm patterns by themselves do not compute any meaningful quantities
70
66
  over graphs, they are merely building blocks for constructing graph
71
67
  algorithms. The graph algorithms in RGL currently include:
@@ -77,7 +73,6 @@ algorithms. The graph algorithms in RGL currently include:
77
73
  * Dijkstras Shortest Path Algorithm {RGL::DijkstraAlgorithm}
78
74
  * Bellman Ford Algorithm {RGL::BellmanFordAlgorithm}
79
75
 
80
-
81
76
  ### Data Structures
82
77
 
83
78
  RGL currently provides two graph classes that implement a generalized
@@ -86,7 +81,6 @@ adjacency list and an edge list adaptor.
86
81
  * {RGL::AdjacencyGraph}
87
82
  * {RGL::ImplicitGraph}
88
83
 
89
-
90
84
  The AdjacencyGraph class is the general purpose _swiss army knife_ of graph
91
85
  classes. It is highly parameterized so that it can be optimized for different
92
86
  situations: the graph is directed or undirected, allow or disallow parallel
@@ -95,20 +89,20 @@ removal at the cost of extra space overhead, etc.
95
89
 
96
90
  ### Differences to BGL
97
91
 
98
- The concepts of IncidenceGraph, AdjacencyGraph and VertexListGraph (see
99
- http://www.boost.org/libs/graph/doc/IncidenceGraph.html) are here bundled in
100
- the base graph module. Most methods of IncidenceGraph should be standard in
101
- the base module Graph. The complexity guarantees can not necessarily provided.
102
- See http://www.boost.org/libs/graph/doc/graph_concepts.html.
92
+ The concepts of IncidenceGraph, AdjacencyGraph and VertexListGraph
93
+ (see [IncidenceGraph](https://www.boost.org/libs/graph/doc/IncidenceGraph.html)) are
94
+ bundled in RGL's base graph module. Most methods of IncidenceGraph
95
+ should be standard in the base module Graph. The complexity guarantees
96
+ can not necessarily provided (see [BGL's Graph Concepts](https://www.boost.org/libs/graph/doc/graph_concepts.html)).
103
97
 
104
98
  ## Installation
105
99
 
106
100
  % gem install rgl
107
101
 
108
- or download the latest sources from the git repository
109
- http://github.com/monora/rgl.
102
+ or download the latest sources from the [git
103
+ repository](https://github.com/monora/rgl).
110
104
 
111
- If you are going to use the drawing functionalities install [Graphviz](http://www.graphviz.org/).
105
+ If you are going to use the drawing functionalities install [Graphviz](https://www.graphviz.org/).
112
106
 
113
107
  ## Running tests
114
108
 
@@ -134,7 +128,7 @@ After that you can run the tests:
134
128
 
135
129
  The result:
136
130
 
137
- ![Example](https://github.com/monora/rgl/raw/master/images/example.jpg)
131
+ ![Example](images/example.jpg)
138
132
 
139
133
  You can control the graph layout by passing layout parameters to `write_to_graphic_file`. See
140
134
  `TestDot::test_to_dot_digraph_with_options` for an example using a feature implemented by Lia
@@ -220,48 +214,45 @@ subgraph of the original graph, using a filtered graph:
220
214
 
221
215
  creates the following graph image with DOT:
222
216
 
223
- ![Module graph](https://github.com/monora/rgl/raw/master/images/module_graph.jpg)
217
+ ![Module graph](images/module_graph.jpg)
224
218
 
225
219
  This graph shows all loaded RGL modules:
226
220
 
227
- ![RGL Modules](https://github.com/monora/rgl/raw/master/images/rgl_modules.png)
221
+ ![RGL Modules](images/rgl_modules.png)
228
222
 
229
223
  Look for more in
230
224
  [examples](https://github.com/monora/rgl/tree/master/examples) directory.
231
225
 
232
- I collect some links to stuff around RGL at http://del.icio.us/monora/rgl.
233
-
234
226
  ## Credits
235
227
 
236
228
  Many thanks to Robert Feldt which also worked on a graph library
237
- (http://rockit.sf.net/subprojects/graphr) who pointed me to BGL and many other
229
+ (https://rockit.sf.net/subprojects/graphr) who pointed me to BGL and many other
238
230
  graph resources.
239
231
 
240
232
  Robert kindly allowed to integrate his work on graphr, which I did not yet
241
233
  succeed. Especially his work to output graphs for
242
- [GraphViz](http://www.graphviz.org) is much more elaborated than the minimal
234
+ [GraphViz](https://www.graphviz.org) is much more elaborated than the minimal
243
235
  support in dot.rb.
244
236
 
245
237
  Jeremy Siek one of the authors of the nice book [The Boost Graph
246
- Library](http://www.boost.org/libs/graph/doc) kindly allowed to use the BGL
238
+ Library](https://www.boost.org/libs/graph/doc) kindly allowed to use the BGL
247
239
  documentation as a *cheap* reference for RGL. He and Robert also gave feedback
248
240
  and many ideas for RGL.
249
241
 
250
- Dave Thomas for [RDoc](http://rdoc.sourceforge.net) which generated what you
242
+ Dave Thomas for [RDoc](https://rdoc.sourceforge.net) which generated what you
251
243
  read and matz for Ruby. Dave included in the latest version of RDoc (alpha9)
252
- the module dot/dot.rb which I use instead of Roberts module to visualize
253
- graphs (see rgl/dot.rb).
254
-
255
- Jeremy Bopp, John Carter, Sascha Doerdelmann, Shawn Garbett, Andreas Schörk
256
- and Kirill Lashuk for contributing additions, test cases and bugfixes.
244
+ the module {RGL::DOT} which is used instead of Roberts module to visualize
245
+ graphs.
257
246
 
258
- Kirill Lashuk who started to take over further development in November 2012.
247
+ Jeremy Bopp, John Carter, Sascha Doerdelmann, Shawn Garbett, Andreas
248
+ Schörk, Dan Čermák and Kirill Lashuk for contributing additions, test
249
+ cases and bugfixes.
259
250
 
260
- See also http://github.com/monora/rgl/contributors.
251
+ See also: https://github.com/monora/rgl/contributors
261
252
 
262
253
  ## Copying
263
254
 
264
- RGL is Copyright (c) 2002,2004,2005,2008,2013,2015,2019,2020 by Horst
255
+ RGL is Copyright (c) 2002,2004,2005,2008,2013,2015,2019,2020,2022 by Horst
265
256
  Duchene. It is free software, and may be redistributed under the [Ruby
266
257
  license](https://en.wikipedia.org/wiki/Ruby_License) and terms specified in
267
258
  the LICENSE file.
data/examples/canvas.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # From c.l.r SNIP IT: bond TkCanvas with RubyGraphLibrary
2
2
  # author: Phlip (see also
3
- # http://www.rubygarden.org/ruby?RubyAlgorithmPackage/TkCanvasSample)
3
+ # https://www.rubygarden.org/ruby?RubyAlgorithmPackage/TkCanvasSample)
4
4
  #
5
5
  # put a GraphViz graph into a TkCanvas, and make nodes
6
6
  # selectable. Illustrates a bug in GraphViz