yargraph 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/yargraph.rb +25 -0
- data/yargraph.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4af761d2f7b31d5e114e1f8e0764653764a3e5d
|
4
|
+
data.tar.gz: 29f199d2b05b451b9b368ef536f8a5140f197be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d105fc5762c0856d857f8c676cebc4efc641f32a775acbea94dac0857c068cdd76c6de0eb2f1e0d62fe67cc622e97e6e0f52d22733866b7dee33cfa7acc37d2
|
7
|
+
data.tar.gz: 66103ba60200d4351c2981720e80257c509c8604c8d279e00e4cff312355c754ba53843b8aab9c9c7ba4f4713440144e5fb5c4f543aa0dc3f24b9f342f27e573
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/yargraph.rb
CHANGED
@@ -75,6 +75,31 @@ module Yargraph
|
|
75
75
|
end
|
76
76
|
return true
|
77
77
|
end
|
78
|
+
|
79
|
+
def delete(v1,v2)
|
80
|
+
@edges[v1].delete v2
|
81
|
+
@edges[v2].delete v1
|
82
|
+
|
83
|
+
@edges.delete v1 if @edges[v1].empty?
|
84
|
+
@edges.delete v2 if @edges[v2].empty?
|
85
|
+
end
|
86
|
+
|
87
|
+
# Remove and return an arbitrary
|
88
|
+
# edge from the Set, or nil if there are no
|
89
|
+
# edges remaining.
|
90
|
+
# Returned is a 2 element Array of vertex1, vertex2
|
91
|
+
def pop
|
92
|
+
pp self
|
93
|
+
each do |v1, v2|
|
94
|
+
delete v1, v2
|
95
|
+
return [v1, v2]
|
96
|
+
end
|
97
|
+
return nil
|
98
|
+
end
|
99
|
+
|
100
|
+
def to_s
|
101
|
+
"EdgeSet: #{collect{|v1,v2| [v1,v2] }.join(',') }"
|
102
|
+
end
|
78
103
|
end
|
79
104
|
|
80
105
|
|
data/yargraph.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: yargraph 0.0.
|
5
|
+
# stub: yargraph 0.0.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "yargraph"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Ben J. Woodcroft"]
|
14
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-07-01"
|
15
15
|
s.description = "Pure Ruby graph algorithms, particularly e.g. Hamiltonian cycles"
|
16
16
|
s.email = "donttrustben near gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yargraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben J. Woodcroft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ds
|