graph_matching 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.rubocop.yml +112 -0
- data/.ruby-version +1 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +205 -0
- data/Rakefile +9 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/benchmark.rb +33 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/compare.gnuplot +19 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/edges_times_vertexes.data +500 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/plot.gnuplot +21 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/plot.png +0 -0
- data/benchmark/mcm_bipartite/complete_bigraphs/time.data +499 -0
- data/benchmark/mcm_general/complete_graphs/benchmark.rb +30 -0
- data/benchmark/mcm_general/complete_graphs/plot.gnuplot +19 -0
- data/benchmark/mcm_general/complete_graphs/plot.png +0 -0
- data/benchmark/mcm_general/complete_graphs/time.data +499 -0
- data/benchmark/mcm_general/complete_graphs/v_cubed.data +500 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/benchmark.rb +43 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/nmN.data +499 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/nmN.xlsx +0 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/plot.gnuplot +22 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/plot.png +0 -0
- data/benchmark/mwm_bipartite/complete_bigraphs/time.data +299 -0
- data/benchmark/mwm_bipartite/misc/calc_d2/benchmark.rb +29 -0
- data/benchmark/mwm_general/complete_graphs/benchmark.rb +32 -0
- data/benchmark/mwm_general/complete_graphs/compare.gnuplot +19 -0
- data/benchmark/mwm_general/complete_graphs/mn_log_n.data +299 -0
- data/benchmark/mwm_general/complete_graphs/mn_log_n.xlsx +0 -0
- data/benchmark/mwm_general/complete_graphs/plot.gnuplot +22 -0
- data/benchmark/mwm_general/complete_graphs/plot.png +0 -0
- data/benchmark/mwm_general/complete_graphs/time.data +299 -0
- data/benchmark/mwm_general/incomplete_graphs/benchmark.rb +39 -0
- data/benchmark/mwm_general/incomplete_graphs/plot.gnuplot +22 -0
- data/benchmark/mwm_general/incomplete_graphs/plot.png +0 -0
- data/benchmark/mwm_general/incomplete_graphs/time_10_pct.data +299 -0
- data/benchmark/mwm_general/incomplete_graphs/time_20_pct.data +299 -0
- data/benchmark/mwm_general/incomplete_graphs/time_30_pct.data +299 -0
- data/graph_matching.gemspec +35 -0
- data/lib/graph_matching.rb +15 -0
- data/lib/graph_matching/algorithm/matching_algorithm.rb +23 -0
- data/lib/graph_matching/algorithm/mcm_bipartite.rb +118 -0
- data/lib/graph_matching/algorithm/mcm_general.rb +289 -0
- data/lib/graph_matching/algorithm/mwm_bipartite.rb +147 -0
- data/lib/graph_matching/algorithm/mwm_general.rb +1086 -0
- data/lib/graph_matching/algorithm/mwmg_delta_assertions.rb +94 -0
- data/lib/graph_matching/assertion.rb +41 -0
- data/lib/graph_matching/core_ext/set.rb +36 -0
- data/lib/graph_matching/directed_edge_set.rb +31 -0
- data/lib/graph_matching/errors.rb +23 -0
- data/lib/graph_matching/graph/bigraph.rb +37 -0
- data/lib/graph_matching/graph/graph.rb +63 -0
- data/lib/graph_matching/graph/weighted.rb +112 -0
- data/lib/graph_matching/graph/weighted_bigraph.rb +17 -0
- data/lib/graph_matching/graph/weighted_graph.rb +17 -0
- data/lib/graph_matching/integer_vertexes.rb +29 -0
- data/lib/graph_matching/matching.rb +120 -0
- data/lib/graph_matching/ordered_set.rb +59 -0
- data/lib/graph_matching/version.rb +6 -0
- data/lib/graph_matching/visualize.rb +93 -0
- data/profile/mcm_bipartite/compare.sh +15 -0
- data/profile/mcm_bipartite/publish.sh +12 -0
- data/profile/mwm_general/compare.sh +15 -0
- data/profile/mwm_general/profile.rb +28 -0
- data/profile/mwm_general/publish.sh +12 -0
- data/research/1965_edmonds.pdf +0 -0
- data/research/1975_even_kariv.pdf +0 -0
- data/research/1976_gabow.pdf +0 -0
- data/research/1980_micali_vazirani.pdf +0 -0
- data/research/1985_gabow.pdf +0 -0
- data/research/2002_tarjan.pdf +0 -0
- data/research/2013_zwick.pdf +0 -0
- data/research/examples/unweighted_general/1.txt +86 -0
- data/research/goodwin.pdf +0 -0
- data/research/kavathekar-scribe.pdf +0 -0
- data/research/kusner.pdf +0 -0
- data/research/van_rantwijk/mwm_example.py +19 -0
- data/research/van_rantwijk/mwmatching.py +945 -0
- data/spec/graph_matching/algorithm/matching_algorithm_spec.rb +14 -0
- data/spec/graph_matching/algorithm/mcm_bipartite_spec.rb +98 -0
- data/spec/graph_matching/algorithm/mcm_general_spec.rb +159 -0
- data/spec/graph_matching/algorithm/mwm_bipartite_spec.rb +82 -0
- data/spec/graph_matching/algorithm/mwm_general_spec.rb +439 -0
- data/spec/graph_matching/graph/bigraph_spec.rb +73 -0
- data/spec/graph_matching/graph/graph_spec.rb +53 -0
- data/spec/graph_matching/graph/weighted_spec.rb +29 -0
- data/spec/graph_matching/integer_vertexes_spec.rb +21 -0
- data/spec/graph_matching/matching_spec.rb +89 -0
- data/spec/graph_matching/visualize_spec.rb +38 -0
- data/spec/graph_matching_spec.rb +9 -0
- data/spec/spec_helper.rb +26 -0
- metadata +263 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe GraphMatching::Graph::Bigraph do
|
6
|
+
let(:g) { described_class.new }
|
7
|
+
|
8
|
+
it 'is a Graph' do
|
9
|
+
expect(g).to be_a(GraphMatching::Graph::Graph)
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#partition' do
|
13
|
+
context 'empty graph' do
|
14
|
+
it 'returns two empty sets' do
|
15
|
+
p = g.partition
|
16
|
+
expect(p.length).to eq(2)
|
17
|
+
p.each do |set|
|
18
|
+
expect(set).to be_a(Set)
|
19
|
+
expect(set).to be_empty
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'graph with single vertex v' do
|
25
|
+
it 'returns two sets, one with v' do
|
26
|
+
v = 0
|
27
|
+
g.add_vertex(v)
|
28
|
+
p = g.partition
|
29
|
+
expect(p[0]).to eq(Set[v])
|
30
|
+
expect(p[1]).to eq(Set[])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'graph with single edge' do
|
35
|
+
it 'returns two disjoint sets, each with one vertex' do
|
36
|
+
e = [0, 1]
|
37
|
+
g.add_edge(*e)
|
38
|
+
p = g.partition
|
39
|
+
expect(p.map(&:first)).to match_array(e)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'complete graph with three vertexes' do
|
44
|
+
it 'raises a NotBipartite error' do
|
45
|
+
g.add_edge('alice', 'bob')
|
46
|
+
g.add_edge('bob', 'carol')
|
47
|
+
g.add_edge('alice', 'carol')
|
48
|
+
expect { g.partition }.to \
|
49
|
+
raise_error(GraphMatching::NotBipartite)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'non-trivial bipartite graph' do
|
54
|
+
it 'returns the expected disjoint sets' do
|
55
|
+
g.add_edge(1, 3)
|
56
|
+
g.add_edge(1, 4)
|
57
|
+
g.add_edge(2, 3)
|
58
|
+
g.add_edge(2, 4)
|
59
|
+
p = g.partition.map(&:sort).sort_by(&:first)
|
60
|
+
expect(p).to match_array([[1, 2], [3, 4]])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'disconnected, yet bipartite graph' do
|
65
|
+
it 'returns one of the the expected disjoint sets' do
|
66
|
+
g = described_class[1, 3, 2, 4]
|
67
|
+
p = g.partition.map(&:sort).sort_by(&:first)
|
68
|
+
permutations = [[[1, 2], [3, 4]], [[1, 4], [2, 3]]]
|
69
|
+
expect(permutations).to include(p)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe GraphMatching::Graph::Graph do
|
6
|
+
ERR_MSG_INT_VERTEXES = 'All vertexes must be integers'
|
7
|
+
|
8
|
+
let(:g) { described_class.new }
|
9
|
+
|
10
|
+
it 'is an RGL::MutableGraph' do
|
11
|
+
expect(g).to be_a(RGL::MutableGraph)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '.[]' do
|
15
|
+
it 'checks that all vertexes are integers' do
|
16
|
+
expect { described_class['a', 'b'] }.to \
|
17
|
+
raise_error(ArgumentError, ERR_MSG_INT_VERTEXES)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '.new' do
|
22
|
+
it 'checks that all vertexes are integers' do
|
23
|
+
g1 = RGL::AdjacencyGraph[1, 'b']
|
24
|
+
g2 = RGL::AdjacencyGraph['a', 2]
|
25
|
+
expect { described_class.new(Set, g1, g2) }.to \
|
26
|
+
raise_error(ArgumentError, ERR_MSG_INT_VERTEXES)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#connected?' do
|
31
|
+
it 'returns true for a connected graph' do
|
32
|
+
g.add_edge('alice', 'bob')
|
33
|
+
expect(g).to be_connected
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'returns false for a disconnected graph' do
|
37
|
+
g.add_edge('alice', 'bob')
|
38
|
+
g.add_edge('yvette', 'zach')
|
39
|
+
expect(g).to_not be_connected
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "#max_v" do
|
44
|
+
it "returns the largest vertex number" do
|
45
|
+
g = described_class[1, 3, 3, 7]
|
46
|
+
expect(g.max_v).to eq(7)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "returns nil when graph is empty" do
|
50
|
+
expect(g.max_v).to eq(nil)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe GraphMatching::Graph::Weighted do
|
6
|
+
# no-doc
|
7
|
+
class MyGraph < RGL::AdjacencyGraph
|
8
|
+
include GraphMatching::Graph::Weighted
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '.[]' do
|
12
|
+
it 'sets weights' do
|
13
|
+
g = MyGraph[[1, 2, 100], [1, 3, 101]]
|
14
|
+
expect(g.w([1, 2])).to eq(100)
|
15
|
+
expect(g.w([1, 3])).to eq(101)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#set_w' do
|
20
|
+
let(:g) { MyGraph[[1, 2, 100]] }
|
21
|
+
let(:edge) { [1, 2] }
|
22
|
+
|
23
|
+
it 'records the assigned weight' do
|
24
|
+
weight = 7
|
25
|
+
g.set_w(edge, weight)
|
26
|
+
expect(g.w(edge)).to eq(weight)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rgl/adjacency'
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'graph_matching/integer_vertexes'
|
6
|
+
|
7
|
+
RSpec.describe GraphMatching::IntegerVertexes do
|
8
|
+
describe '.to_integers' do
|
9
|
+
it 'returns new graph with vertexes converted to integers, and a legend' do
|
10
|
+
e = %w[a b]
|
11
|
+
g1 = RGL::AdjacencyGraph[*e]
|
12
|
+
g2, legend = described_class.to_integers(g1)
|
13
|
+
expect(g2.size).to eq(g1.size)
|
14
|
+
expect(g2.vertices).to eq(1.upto(g1.size).to_a)
|
15
|
+
expect(g2.num_edges).to eq(g1.num_edges)
|
16
|
+
legend.keys.map(&:class).uniq.each do |klass|
|
17
|
+
expect(klass).to be < Integer
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe GraphMatching::Matching do
|
6
|
+
describe '.gabow' do
|
7
|
+
context 'when nil is used as a placeholder' do
|
8
|
+
it 'returns a Matching' do
|
9
|
+
a = [nil, 2, 1, nil, 5, 4]
|
10
|
+
m = described_class.gabow(a)
|
11
|
+
expect(m.edge?([1, 2])).to eq(true)
|
12
|
+
expect(m.edge?([4, 5])).to eq(true)
|
13
|
+
expect(m.vertex?(3)).to eq(false)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when 0 is used as a placeholder' do
|
18
|
+
it 'returns a Matching' do
|
19
|
+
a = [0, 2, 1]
|
20
|
+
m = described_class.gabow(a)
|
21
|
+
expect(m.edge?([1, 2])).to eq(true)
|
22
|
+
expect(m.vertex?(3)).to eq(false)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#delete' do
|
28
|
+
it 'removes edge' do
|
29
|
+
e = [2, 3]
|
30
|
+
m = described_class[e]
|
31
|
+
expect(m.edge?(e)).to eq(true)
|
32
|
+
m.delete(e)
|
33
|
+
expect(m.edge?(e)).to eq(false)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#empty?' do
|
38
|
+
context 'when initialized' do
|
39
|
+
it 'returns true' do
|
40
|
+
expect(described_class.new.empty?).to eq(true)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'with one or more edges' do
|
45
|
+
it 'returns false' do
|
46
|
+
expect(described_class[[1, 2]].empty?).to eq(false)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#edge?' do
|
52
|
+
it 'returns true if edge found' do
|
53
|
+
m = described_class.new
|
54
|
+
expect(m.edge?([1, 2])).to eq(false)
|
55
|
+
m.add([1, 2])
|
56
|
+
expect(m.edge?([1, 2])).to eq(true)
|
57
|
+
m.add([4, 3])
|
58
|
+
expect(m.edge?([3, 4])).to eq(true)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#vertex?' do
|
63
|
+
it 'returns true if vertex found' do
|
64
|
+
m = described_class.new
|
65
|
+
expect(m.vertex?(1)).to eq(false)
|
66
|
+
expect(m.vertex?(2)).to eq(false)
|
67
|
+
m.add([1, 2])
|
68
|
+
expect(m.vertex?(1)).to eq(true)
|
69
|
+
expect(m.vertex?(2)).to eq(true)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe '#to_a' do
|
74
|
+
it 'returns edges' do
|
75
|
+
edges = [[1, 2], [3, 4]]
|
76
|
+
m = described_class[*edges]
|
77
|
+
expect(m.to_a).to eq(edges)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#vertexes' do
|
82
|
+
it 'returns array of matched vertexes' do
|
83
|
+
expect(described_class.new.vertexes).to be_empty
|
84
|
+
expect(described_class[[3, 4]].vertexes).to match_array([3, 4])
|
85
|
+
expect(described_class[[1, 2], [3, 4]].vertexes).to \
|
86
|
+
match_array([1, 2, 3, 4])
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require_relative '../spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe GraphMatching::Visualize do
|
6
|
+
describe '.new' do
|
7
|
+
it 'initializes with a graph' do
|
8
|
+
g = double
|
9
|
+
v = described_class.new(g)
|
10
|
+
expect(v.graph).to eq(g)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#dot' do
|
15
|
+
let(:g) { GraphMatching::Graph::Graph.new }
|
16
|
+
|
17
|
+
def normalize_ws(str)
|
18
|
+
str.gsub(/\s+/, ' ').strip
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'given a graph with a single edge' do
|
22
|
+
it 'returns a string in .dot format' do
|
23
|
+
g.add_edge('alice', 'bob')
|
24
|
+
str = described_class.new(g).dot
|
25
|
+
expect(normalize_ws(str)).to eq('graph { alice -- bob }')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'given a graph with two edges' do
|
30
|
+
it 'returns a string in .dot format' do
|
31
|
+
g.add_edge('alice', 'bob')
|
32
|
+
g.add_edge('tom', 'jerry')
|
33
|
+
str = described_class.new(g).dot
|
34
|
+
expect(normalize_ws(str)).to eq('graph { alice -- bob tom -- jerry }')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
4
|
+
require 'graph_matching'
|
5
|
+
require 'pry'
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.disable_monkey_patching!
|
9
|
+
config.filter_run_including(focus: true)
|
10
|
+
config.run_all_when_everything_filtered = true
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec::Matchers.define(:match_edges) do |expected|
|
14
|
+
match do |matching|
|
15
|
+
fail TypeError unless matching.is_a?(GraphMatching::Matching)
|
16
|
+
fail TypeError unless expected.is_a?(Array)
|
17
|
+
se = Set.new(expected.map { |e| RGL::Edge::UnDirectedEdge.new(*e) })
|
18
|
+
sa = Set.new(matching.undirected_edges)
|
19
|
+
se == sa
|
20
|
+
end
|
21
|
+
|
22
|
+
failure_message do |matching|
|
23
|
+
edges_desc = to_sentence(expected)
|
24
|
+
"expected #{matching.edges} to equal" + edges_desc
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: graph_matching
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jared Beck
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rgl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.5.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-nav
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-core
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec-expectations
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.2'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec-mocks
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: |2
|
126
|
+
Efficient algorithms for maximum cardinality
|
127
|
+
and weighted matchings in undirected graphs.
|
128
|
+
email:
|
129
|
+
- jared@jaredbeck.com
|
130
|
+
executables: []
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- ".gitignore"
|
135
|
+
- ".rubocop.yml"
|
136
|
+
- ".ruby-version"
|
137
|
+
- ".travis.yml"
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE.txt
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- benchmark/mcm_bipartite/complete_bigraphs/benchmark.rb
|
143
|
+
- benchmark/mcm_bipartite/complete_bigraphs/compare.gnuplot
|
144
|
+
- benchmark/mcm_bipartite/complete_bigraphs/edges_times_vertexes.data
|
145
|
+
- benchmark/mcm_bipartite/complete_bigraphs/plot.gnuplot
|
146
|
+
- benchmark/mcm_bipartite/complete_bigraphs/plot.png
|
147
|
+
- benchmark/mcm_bipartite/complete_bigraphs/time.data
|
148
|
+
- benchmark/mcm_general/complete_graphs/benchmark.rb
|
149
|
+
- benchmark/mcm_general/complete_graphs/plot.gnuplot
|
150
|
+
- benchmark/mcm_general/complete_graphs/plot.png
|
151
|
+
- benchmark/mcm_general/complete_graphs/time.data
|
152
|
+
- benchmark/mcm_general/complete_graphs/v_cubed.data
|
153
|
+
- benchmark/mwm_bipartite/complete_bigraphs/benchmark.rb
|
154
|
+
- benchmark/mwm_bipartite/complete_bigraphs/nmN.data
|
155
|
+
- benchmark/mwm_bipartite/complete_bigraphs/nmN.xlsx
|
156
|
+
- benchmark/mwm_bipartite/complete_bigraphs/plot.gnuplot
|
157
|
+
- benchmark/mwm_bipartite/complete_bigraphs/plot.png
|
158
|
+
- benchmark/mwm_bipartite/complete_bigraphs/time.data
|
159
|
+
- benchmark/mwm_bipartite/misc/calc_d2/benchmark.rb
|
160
|
+
- benchmark/mwm_general/complete_graphs/benchmark.rb
|
161
|
+
- benchmark/mwm_general/complete_graphs/compare.gnuplot
|
162
|
+
- benchmark/mwm_general/complete_graphs/mn_log_n.data
|
163
|
+
- benchmark/mwm_general/complete_graphs/mn_log_n.xlsx
|
164
|
+
- benchmark/mwm_general/complete_graphs/plot.gnuplot
|
165
|
+
- benchmark/mwm_general/complete_graphs/plot.png
|
166
|
+
- benchmark/mwm_general/complete_graphs/time.data
|
167
|
+
- benchmark/mwm_general/incomplete_graphs/benchmark.rb
|
168
|
+
- benchmark/mwm_general/incomplete_graphs/plot.gnuplot
|
169
|
+
- benchmark/mwm_general/incomplete_graphs/plot.png
|
170
|
+
- benchmark/mwm_general/incomplete_graphs/time_10_pct.data
|
171
|
+
- benchmark/mwm_general/incomplete_graphs/time_20_pct.data
|
172
|
+
- benchmark/mwm_general/incomplete_graphs/time_30_pct.data
|
173
|
+
- graph_matching.gemspec
|
174
|
+
- lib/graph_matching.rb
|
175
|
+
- lib/graph_matching/algorithm/matching_algorithm.rb
|
176
|
+
- lib/graph_matching/algorithm/mcm_bipartite.rb
|
177
|
+
- lib/graph_matching/algorithm/mcm_general.rb
|
178
|
+
- lib/graph_matching/algorithm/mwm_bipartite.rb
|
179
|
+
- lib/graph_matching/algorithm/mwm_general.rb
|
180
|
+
- lib/graph_matching/algorithm/mwmg_delta_assertions.rb
|
181
|
+
- lib/graph_matching/assertion.rb
|
182
|
+
- lib/graph_matching/core_ext/set.rb
|
183
|
+
- lib/graph_matching/directed_edge_set.rb
|
184
|
+
- lib/graph_matching/errors.rb
|
185
|
+
- lib/graph_matching/graph/bigraph.rb
|
186
|
+
- lib/graph_matching/graph/graph.rb
|
187
|
+
- lib/graph_matching/graph/weighted.rb
|
188
|
+
- lib/graph_matching/graph/weighted_bigraph.rb
|
189
|
+
- lib/graph_matching/graph/weighted_graph.rb
|
190
|
+
- lib/graph_matching/integer_vertexes.rb
|
191
|
+
- lib/graph_matching/matching.rb
|
192
|
+
- lib/graph_matching/ordered_set.rb
|
193
|
+
- lib/graph_matching/version.rb
|
194
|
+
- lib/graph_matching/visualize.rb
|
195
|
+
- profile/mcm_bipartite/compare.sh
|
196
|
+
- profile/mcm_bipartite/publish.sh
|
197
|
+
- profile/mwm_general/compare.sh
|
198
|
+
- profile/mwm_general/profile.rb
|
199
|
+
- profile/mwm_general/publish.sh
|
200
|
+
- research/1965_edmonds.pdf
|
201
|
+
- research/1975_even_kariv.pdf
|
202
|
+
- research/1976_gabow.pdf
|
203
|
+
- research/1980_micali_vazirani.pdf
|
204
|
+
- research/1985_gabow.pdf
|
205
|
+
- research/2002_tarjan.pdf
|
206
|
+
- research/2013_zwick.pdf
|
207
|
+
- research/examples/unweighted_general/1.txt
|
208
|
+
- research/goodwin.pdf
|
209
|
+
- research/kavathekar-scribe.pdf
|
210
|
+
- research/kusner.pdf
|
211
|
+
- research/van_rantwijk/mwm_example.py
|
212
|
+
- research/van_rantwijk/mwmatching.py
|
213
|
+
- spec/graph_matching/algorithm/matching_algorithm_spec.rb
|
214
|
+
- spec/graph_matching/algorithm/mcm_bipartite_spec.rb
|
215
|
+
- spec/graph_matching/algorithm/mcm_general_spec.rb
|
216
|
+
- spec/graph_matching/algorithm/mwm_bipartite_spec.rb
|
217
|
+
- spec/graph_matching/algorithm/mwm_general_spec.rb
|
218
|
+
- spec/graph_matching/graph/bigraph_spec.rb
|
219
|
+
- spec/graph_matching/graph/graph_spec.rb
|
220
|
+
- spec/graph_matching/graph/weighted_spec.rb
|
221
|
+
- spec/graph_matching/integer_vertexes_spec.rb
|
222
|
+
- spec/graph_matching/matching_spec.rb
|
223
|
+
- spec/graph_matching/visualize_spec.rb
|
224
|
+
- spec/graph_matching_spec.rb
|
225
|
+
- spec/spec_helper.rb
|
226
|
+
homepage: https://github.com/jaredbeck/graph_matching
|
227
|
+
licenses:
|
228
|
+
- MIT
|
229
|
+
metadata: {}
|
230
|
+
post_install_message:
|
231
|
+
rdoc_options: []
|
232
|
+
require_paths:
|
233
|
+
- lib
|
234
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
235
|
+
requirements:
|
236
|
+
- - ">="
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
version: 1.9.3
|
239
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
requirements: []
|
245
|
+
rubyforge_project:
|
246
|
+
rubygems_version: 2.4.5
|
247
|
+
signing_key:
|
248
|
+
specification_version: 4
|
249
|
+
summary: Finds maximum matchings in undirected graphs.
|
250
|
+
test_files:
|
251
|
+
- spec/graph_matching/algorithm/matching_algorithm_spec.rb
|
252
|
+
- spec/graph_matching/algorithm/mcm_bipartite_spec.rb
|
253
|
+
- spec/graph_matching/algorithm/mcm_general_spec.rb
|
254
|
+
- spec/graph_matching/algorithm/mwm_bipartite_spec.rb
|
255
|
+
- spec/graph_matching/algorithm/mwm_general_spec.rb
|
256
|
+
- spec/graph_matching/graph/bigraph_spec.rb
|
257
|
+
- spec/graph_matching/graph/graph_spec.rb
|
258
|
+
- spec/graph_matching/graph/weighted_spec.rb
|
259
|
+
- spec/graph_matching/integer_vertexes_spec.rb
|
260
|
+
- spec/graph_matching/matching_spec.rb
|
261
|
+
- spec/graph_matching/visualize_spec.rb
|
262
|
+
- spec/graph_matching_spec.rb
|
263
|
+
- spec/spec_helper.rb
|