or-tools 0.4.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/ext/or-tools/assignment.cpp +2 -5
- data/ext/or-tools/bin_packing.cpp +26 -33
- data/ext/or-tools/constraint.cpp +203 -210
- data/ext/or-tools/ext.cpp +3 -3
- data/ext/or-tools/ext.h +4 -0
- data/ext/or-tools/extconf.rb +1 -3
- data/ext/or-tools/linear.cpp +74 -67
- data/ext/or-tools/network_flows.cpp +7 -9
- data/ext/or-tools/routing.cpp +70 -147
- data/ext/or-tools/vendor.rb +25 -11
- data/lib/or_tools/cp_solver.rb +4 -0
- data/lib/or_tools/seating.rb +1 -1
- data/lib/or_tools/version.rb +1 -1
- metadata +6 -61
data/ext/or-tools/vendor.rb
CHANGED
|
@@ -3,31 +3,43 @@ require "fileutils"
|
|
|
3
3
|
require "net/http"
|
|
4
4
|
require "tmpdir"
|
|
5
5
|
|
|
6
|
-
version = "
|
|
6
|
+
version = "9.0.9048"
|
|
7
7
|
|
|
8
8
|
if RbConfig::CONFIG["host_os"] =~ /darwin/i
|
|
9
|
-
filename = "or-tools_MacOsX-
|
|
10
|
-
checksum = "
|
|
9
|
+
filename = "or-tools_MacOsX-11.2.3_v#{version}.tar.gz"
|
|
10
|
+
checksum = "adf73a00d4ec49558b67be5ce3cfc8f30268da2253b35feb11d0d40700550bf6"
|
|
11
11
|
else
|
|
12
12
|
os = %x[lsb_release -is].chomp rescue nil
|
|
13
13
|
os_version = %x[lsb_release -rs].chomp rescue nil
|
|
14
14
|
if os == "Ubuntu" && os_version == "20.04"
|
|
15
15
|
filename = "or-tools_ubuntu-20.04_v#{version}.tar.gz"
|
|
16
|
-
checksum = "
|
|
16
|
+
checksum = "5565343c1c310d2885a40ce850ae7e3468299b3fee97ae8eed8425ce06bd4960"
|
|
17
17
|
elsif os == "Ubuntu" && os_version == "18.04"
|
|
18
18
|
filename = "or-tools_ubuntu-18.04_v#{version}.tar.gz"
|
|
19
|
-
checksum = "
|
|
19
|
+
checksum = "08cf548d0179f7fa814bb7458be94cd1b8a3de14985e6a9faf6118a1d8571539"
|
|
20
20
|
elsif os == "Debian" && os_version == "10"
|
|
21
|
-
filename = "or-tools_debian-10_v#{version}.tar.gz
|
|
22
|
-
checksum = "
|
|
21
|
+
filename = "or-tools_debian-10_v#{version}.tar.gz"
|
|
22
|
+
checksum = "063fb1d8765ae23b0bb25b9c561e904532713416fe0458f7db45a0f72190eb50"
|
|
23
23
|
elsif os == "CentOS" && os_version == "8"
|
|
24
24
|
filename = "or-tools_centos-8_v#{version}.tar.gz"
|
|
25
|
-
checksum = "
|
|
25
|
+
checksum = "c98212ed4fc699d8ae70c1f53cd1d8dacd28e52970336fab5b86dedf7406f215"
|
|
26
|
+
elsif os == "CentOS" && os_version == "7"
|
|
27
|
+
filename = "or-tools_centos-7_v#{version}.tar.gz"
|
|
28
|
+
checksum = "b992bda4614bbc703583b0e9edcd2ade54bacfb9909399b20c8aa95ff7197d68"
|
|
26
29
|
else
|
|
30
|
+
platform =
|
|
31
|
+
if Gem.win_platform?
|
|
32
|
+
"Windows"
|
|
33
|
+
elsif os || os_version
|
|
34
|
+
"#{os} #{os_version}"
|
|
35
|
+
else
|
|
36
|
+
"Unknown"
|
|
37
|
+
end
|
|
38
|
+
|
|
27
39
|
# there is a binary download for Windows
|
|
28
40
|
# however, it's compiled with Visual Studio rather than MinGW (which RubyInstaller uses)
|
|
29
41
|
raise <<~MSG
|
|
30
|
-
Binary installation not available for this platform
|
|
42
|
+
Binary installation not available for this platform: #{platform}
|
|
31
43
|
|
|
32
44
|
Build the OR-Tools C++ library from source, then run:
|
|
33
45
|
bundle config build.or-tools --with-or-tools-dir=/path/to/or-tools
|
|
@@ -41,7 +53,9 @@ url = "https://github.com/google/or-tools/releases/download/v#{short_version}/#{
|
|
|
41
53
|
|
|
42
54
|
$stdout.sync = true
|
|
43
55
|
|
|
44
|
-
def download_file(url, download_path)
|
|
56
|
+
def download_file(url, download_path, redirects = 0)
|
|
57
|
+
raise "Too many redirects" if redirects > 10
|
|
58
|
+
|
|
45
59
|
uri = URI(url)
|
|
46
60
|
location = nil
|
|
47
61
|
|
|
@@ -70,7 +84,7 @@ def download_file(url, download_path)
|
|
|
70
84
|
end
|
|
71
85
|
|
|
72
86
|
# outside of Net::HTTP block to close previous connection
|
|
73
|
-
download_file(location, download_path) if location
|
|
87
|
+
download_file(location, download_path, redirects + 1) if location
|
|
74
88
|
end
|
|
75
89
|
|
|
76
90
|
# download
|
data/lib/or_tools/cp_solver.rb
CHANGED
data/lib/or_tools/seating.rb
CHANGED
|
@@ -78,7 +78,7 @@ module ORTools
|
|
|
78
78
|
|
|
79
79
|
# min known neighbors rule
|
|
80
80
|
same_table_by_person = Hash.new { |hash, key| hash[key] = [] }
|
|
81
|
-
same_table.each do |(g1, g2,
|
|
81
|
+
same_table.each do |(g1, g2, _t), v|
|
|
82
82
|
next unless @connections_for[g1][g2]
|
|
83
83
|
same_table_by_person[g1] << v
|
|
84
84
|
same_table_by_person[g2] << v
|
data/lib/or_tools/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: or-tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rice
|
|
@@ -16,72 +16,16 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.0.2
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
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: rake
|
|
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: rake-compiler
|
|
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: minitest
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '5'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '5'
|
|
26
|
+
version: 4.0.2
|
|
83
27
|
description:
|
|
84
|
-
email: andrew@
|
|
28
|
+
email: andrew@ankane.org
|
|
85
29
|
executables: []
|
|
86
30
|
extensions:
|
|
87
31
|
- ext/or-tools/extconf.rb
|
|
@@ -95,6 +39,7 @@ files:
|
|
|
95
39
|
- ext/or-tools/bin_packing.cpp
|
|
96
40
|
- ext/or-tools/constraint.cpp
|
|
97
41
|
- ext/or-tools/ext.cpp
|
|
42
|
+
- ext/or-tools/ext.h
|
|
98
43
|
- ext/or-tools/extconf.rb
|
|
99
44
|
- ext/or-tools/linear.cpp
|
|
100
45
|
- ext/or-tools/network_flows.cpp
|