mementus 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mementus/library/herschel_graph.rb +116 -0
- data/lib/mementus/library.rb +1 -0
- data/lib/mementus/version.rb +1 -1
- data/spec/herschel_spec.rb +13 -0
- data/spec/spec_helper.rb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5be27f3627a1c98758d9c342f3caf1e66f5fe70
|
4
|
+
data.tar.gz: aeb311c257b6107697ebc02aaad5dddb88f64030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23ea3552c0307467dd23b1066466c663087573219b4d2261f440dc85d5dd671c5f19c341000b690c3b1e8d55250307bf1532acb511e6de9a9319a90eafad0281
|
7
|
+
data.tar.gz: e035bb59dd2c6298cc2301e97e5f738cf50f06cb4df4680673cee7514b674217dc8b45a312260a23253fb5eca95021d98cc14d6c3b1f42f6a24db9839ebf465a
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# The Herschel graph is a bipartite undirected graph with 11 vertices and
|
2
|
+
# 18 edges, the smallest non-Hamiltonian polyhedral graph.
|
3
|
+
#
|
4
|
+
# __________(blue-1)__________
|
5
|
+
# / / \ \
|
6
|
+
# / / \ \
|
7
|
+
# / (red-1) (red-2) \
|
8
|
+
# / / \ / \ \
|
9
|
+
# / / \ / \ \
|
10
|
+
# (red-3)--(blue-2) (blue-3) (blue-4)---(red-4)
|
11
|
+
# \ \ / \ / /
|
12
|
+
# \ \ / \ / /
|
13
|
+
# \ (red-5) (red-6) /
|
14
|
+
# \ \ / /
|
15
|
+
# \ \ / /
|
16
|
+
# \_________(blue-5)_________/
|
17
|
+
#
|
18
|
+
module Mementus
|
19
|
+
module Library
|
20
|
+
class HerschelGraph < Graph
|
21
|
+
def self.instance
|
22
|
+
self.new do
|
23
|
+
create_edge do |edge|
|
24
|
+
edge.from = "red-1"
|
25
|
+
edge.to = "blue-1"
|
26
|
+
end
|
27
|
+
|
28
|
+
create_edge do |edge|
|
29
|
+
edge.from = "red-1"
|
30
|
+
edge.to = "blue-2"
|
31
|
+
end
|
32
|
+
|
33
|
+
create_edge do |edge|
|
34
|
+
edge.from = "red-1"
|
35
|
+
edge.to = "blue-3"
|
36
|
+
end
|
37
|
+
|
38
|
+
create_edge do |edge|
|
39
|
+
edge.from = "red-2"
|
40
|
+
edge.to = "blue-1"
|
41
|
+
end
|
42
|
+
|
43
|
+
create_edge do |edge|
|
44
|
+
edge.from = "red-2"
|
45
|
+
edge.to = "blue-3"
|
46
|
+
end
|
47
|
+
|
48
|
+
create_edge do |edge|
|
49
|
+
edge.from = "red-2"
|
50
|
+
edge.to = "blue-4"
|
51
|
+
end
|
52
|
+
|
53
|
+
create_edge do |edge|
|
54
|
+
edge.from = "red-3"
|
55
|
+
edge.to = "blue-1"
|
56
|
+
end
|
57
|
+
|
58
|
+
create_edge do |edge|
|
59
|
+
edge.from = "red-3"
|
60
|
+
edge.to = "blue-2"
|
61
|
+
end
|
62
|
+
|
63
|
+
create_edge do |edge|
|
64
|
+
edge.from = "red-3"
|
65
|
+
edge.to = "blue-5"
|
66
|
+
end
|
67
|
+
|
68
|
+
create_edge do |edge|
|
69
|
+
edge.from = "red-4"
|
70
|
+
edge.to = "blue-1"
|
71
|
+
end
|
72
|
+
|
73
|
+
create_edge do |edge|
|
74
|
+
edge.from = "red-4"
|
75
|
+
edge.to = "blue-4"
|
76
|
+
end
|
77
|
+
|
78
|
+
create_edge do |edge|
|
79
|
+
edge.from = "red-4"
|
80
|
+
edge.to = "blue-5"
|
81
|
+
end
|
82
|
+
|
83
|
+
create_edge do |edge|
|
84
|
+
edge.from = "red-5"
|
85
|
+
edge.to = "blue-2"
|
86
|
+
end
|
87
|
+
|
88
|
+
create_edge do |edge|
|
89
|
+
edge.from = "red-5"
|
90
|
+
edge.to = "blue-3"
|
91
|
+
end
|
92
|
+
|
93
|
+
create_edge do |edge|
|
94
|
+
edge.from = "red-5"
|
95
|
+
edge.to = "blue-5"
|
96
|
+
end
|
97
|
+
|
98
|
+
create_edge do |edge|
|
99
|
+
edge.from = "red-6"
|
100
|
+
edge.to = "blue-3"
|
101
|
+
end
|
102
|
+
|
103
|
+
create_edge do |edge|
|
104
|
+
edge.from = "red-6"
|
105
|
+
edge.to = "blue-4"
|
106
|
+
end
|
107
|
+
|
108
|
+
create_edge do |edge|
|
109
|
+
edge.from = "red-6"
|
110
|
+
edge.to = "blue-5"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'mementus/library/herschel_graph'
|
data/lib/mementus/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
describe Mementus::Library::HerschelGraph do
|
2
|
+
let(:graph) do
|
3
|
+
Mementus::Library::HerschelGraph.instance
|
4
|
+
end
|
5
|
+
|
6
|
+
it 'has 11 vertices' do
|
7
|
+
expect(graph.nodes_count).to eq(11)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'has 18 edges' do
|
11
|
+
expect(graph.edges_count).to eq(18)
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mementus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maetl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,6 +74,8 @@ files:
|
|
74
74
|
- lib/mementus/graph.rb
|
75
75
|
- lib/mementus/graph_builder.rb
|
76
76
|
- lib/mementus/integer_id.rb
|
77
|
+
- lib/mementus/library.rb
|
78
|
+
- lib/mementus/library/herschel_graph.rb
|
77
79
|
- lib/mementus/node.rb
|
78
80
|
- lib/mementus/node_builder.rb
|
79
81
|
- lib/mementus/node_proxy.rb
|
@@ -88,6 +90,7 @@ files:
|
|
88
90
|
- spec/direction_spec.rb
|
89
91
|
- spec/edge_spec.rb
|
90
92
|
- spec/graph_spec.rb
|
93
|
+
- spec/herschel_spec.rb
|
91
94
|
- spec/integer_id_spec.rb
|
92
95
|
- spec/node_proxy_spec.rb
|
93
96
|
- spec/pipeline_spec.rb
|
@@ -123,6 +126,7 @@ test_files:
|
|
123
126
|
- spec/direction_spec.rb
|
124
127
|
- spec/edge_spec.rb
|
125
128
|
- spec/graph_spec.rb
|
129
|
+
- spec/herschel_spec.rb
|
126
130
|
- spec/integer_id_spec.rb
|
127
131
|
- spec/node_proxy_spec.rb
|
128
132
|
- spec/pipeline_spec.rb
|