Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support blmo type and passed test for Cube polytope #188

Draft
wants to merge 288 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
288 commits
Select commit Hold shift + click to select a range
b780ff9
Update frank_wolfe_variants.jl; rename
WenjieXiao-2022 May 2, 2024
9358be1
Update node.jl; rename
WenjieXiao-2022 May 2, 2024
37db78e
Update frank_wolfe_variants.jl; typo
WenjieXiao-2022 May 2, 2024
575b59e
Update frank_wolfe_variants.jl; typo
WenjieXiao-2022 May 2, 2024
92c865c
Update managed_blmo.jl
WenjieXiao-2022 May 2, 2024
f3bb09d
Update time_tracking_lmo.jl; support dicg
WenjieXiao-2022 May 2, 2024
41acb88
Update Boscia.jl
WenjieXiao-2022 May 2, 2024
79a0632
Update time_tracking_lmo.jl ; wrap blmo
WenjieXiao-2022 May 2, 2024
e233774
Update managed_blmo.jl; typo
WenjieXiao-2022 May 2, 2024
4fed869
Update time_tracking_lmo.jl; realize them
WenjieXiao-2022 May 2, 2024
4b6a9dd
Update polytope_blmos.jl; typo
WenjieXiao-2022 May 2, 2024
4c4525a
Update node.jl; typo
WenjieXiao-2022 May 2, 2024
2986f09
Update node.jl; typos
WenjieXiao-2022 May 2, 2024
58bb3a8
Update node.jl; typos
WenjieXiao-2022 May 2, 2024
4f28786
Update node.jl
WenjieXiao-2022 May 2, 2024
8d84486
Update frank_wolfe_variants.jl; remove test
WenjieXiao-2022 May 2, 2024
2cda5e9
Update managed_blmo.jl; added interface for Probability and unit simp…
WenjieXiao-2022 May 2, 2024
e7d2a5e
Update time_tracking_lmo.jl;
WenjieXiao-2022 May 2, 2024
511b5d1
Update managed_blmo.jl; check if all vertices lie on zero one
WenjieXiao-2022 May 2, 2024
5c3c87d
Update managed_blmo.jl; typos
WenjieXiao-2022 May 2, 2024
043bf12
Update time_tracking_lmo.jl; typos
WenjieXiao-2022 May 2, 2024
0b467ea
Update time_tracking_lmo.jl; rename
WenjieXiao-2022 May 2, 2024
c5d5d67
Update managed_blmo.jl; rename
WenjieXiao-2022 May 2, 2024
99da228
Update managed_blmo.jl; for testing
WenjieXiao-2022 May 2, 2024
76063bb
Update time_tracking_lmo.jl; for testing
WenjieXiao-2022 May 2, 2024
5b8ba77
Update managed_blmo.jl; testing
WenjieXiao-2022 May 2, 2024
52d5b2e
Update time_tracking_lmo.jl; changed arguments
WenjieXiao-2022 May 3, 2024
204fca0
Update managed_blmo.jl; put three polytope together
WenjieXiao-2022 May 3, 2024
ad23437
Update managed_blmo.jl
WenjieXiao-2022 May 3, 2024
604a836
Update managed_blmo.jl
WenjieXiao-2022 May 3, 2024
ff47ad3
Update time_tracking_lmo.jl
WenjieXiao-2022 May 3, 2024
8cae0e6
Update managed_blmo.jl; typos
WenjieXiao-2022 May 3, 2024
04d0d13
Update managed_blmo.jl ; for testing
WenjieXiao-2022 May 3, 2024
d3109b3
Update managed_blmo.jl; typo
WenjieXiao-2022 May 3, 2024
ae3d206
Update managed_blmo.jl
WenjieXiao-2022 May 3, 2024
53efbd2
Update managed_blmo.jl; typos
WenjieXiao-2022 May 3, 2024
605ad58
Update managed_blmo.jl; for testing
WenjieXiao-2022 May 3, 2024
698ddef
Update managed_blmo.jl; remove test
WenjieXiao-2022 May 3, 2024
08673fd
Update managed_blmo.jl; remove test
WenjieXiao-2022 May 3, 2024
9c2aaea
Update managed_blmo.jl; typos
WenjieXiao-2022 May 3, 2024
f5a1027
Update managed_blmo.jl; for testing
WenjieXiao-2022 May 3, 2024
9840eab
Update time_tracking_lmo.jl; for testing
WenjieXiao-2022 May 3, 2024
d678018
Update time_tracking_lmo.jl; for testing
WenjieXiao-2022 May 3, 2024
1299a22
Update managed_blmo.jl; remove testing
WenjieXiao-2022 May 3, 2024
6b9f3d3
Update time_tracking_lmo.jl; remove testing
WenjieXiao-2022 May 3, 2024
689bce2
Update node.jl; different ways to split active set
WenjieXiao-2022 May 3, 2024
9d4c1aa
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 3, 2024
17a4e67
Update managed_blmo.jl; formatting
WenjieXiao-2022 May 3, 2024
62e7d7a
Update time_tracking_lmo.jl; track time
WenjieXiao-2022 May 3, 2024
3ccdb58
Update time_tracking_lmo.jl; typos
WenjieXiao-2022 May 3, 2024
686804f
Update frank_wolfe_variants.jl; support vanilla Frank Wolfe
WenjieXiao-2022 May 3, 2024
bb0c7c7
Update node.jl; support vanilla Frank Wolfe
WenjieXiao-2022 May 3, 2024
e233828
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 3, 2024
40f4149
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 3, 2024
fc44d9d
Update frank_wolfe_variants.jl; rename
WenjieXiao-2022 May 3, 2024
ae7432d
Update managed_blmo.jl; deleted one redundant indicator
WenjieXiao-2022 May 3, 2024
46c56fe
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
4c09b6f
Update managed_blmo.jl
WenjieXiao-2022 May 4, 2024
fd81107
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
2637b43
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
a13d32b
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
35032ac
Update managed_blmo.jl; typos
WenjieXiao-2022 May 4, 2024
7bee017
Update polytope_blmos.jl; typo
WenjieXiao-2022 May 4, 2024
e3fc427
Update polytope_blmos.jl; simplify
WenjieXiao-2022 May 4, 2024
bdbd5cd
Update polytope_blmos.jl; typo
WenjieXiao-2022 May 4, 2024
c62f6a2
Update polytope_blmos.jl;
WenjieXiao-2022 May 4, 2024
01cc4c2
Update polytope_blmos.jl; typos
WenjieXiao-2022 May 4, 2024
8a09abe
Update polytope_blmos.jl; typos
WenjieXiao-2022 May 4, 2024
628f9b8
Update node.jl
WenjieXiao-2022 May 4, 2024
7faef63
Update managed_blmo.jl; reconstruction
WenjieXiao-2022 May 4, 2024
f3d733d
Update polytope_blmos.jl; reconstruct
WenjieXiao-2022 May 4, 2024
44823a3
Update polytope_blmos.jl; typo
WenjieXiao-2022 May 4, 2024
bfb0b5a
Update polytope_blmos.jl; missing argument
WenjieXiao-2022 May 4, 2024
be00e8a
Update polytope_blmos.jl; typo
WenjieXiao-2022 May 4, 2024
aee13de
Update managed_blmo.jl
WenjieXiao-2022 May 4, 2024
2acb279
Update managed_blmo.jl
WenjieXiao-2022 May 4, 2024
0a606dd
Update managed_blmo.jl; typos
WenjieXiao-2022 May 4, 2024
7977614
Update time_tracking_lmo.jl
WenjieXiao-2022 May 4, 2024
635cd3e
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
9e5ccec
Update polytope_blmos.jl; typos
WenjieXiao-2022 May 4, 2024
e839f08
Update polytope_blmos.jl; scaled hot vec type
WenjieXiao-2022 May 4, 2024
5696475
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
83db28d
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
a20ec22
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
841f772
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
163aff7
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
057d765
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
80b31b9
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
4e32e95
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
0348146
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
2397013
Update node.jl; test
WenjieXiao-2022 May 4, 2024
afb1eab
Update node.jl; test
WenjieXiao-2022 May 4, 2024
8e0e9a3
Update polytope_blmos.jl; test
WenjieXiao-2022 May 4, 2024
8f26376
Update polytope_blmos.jl; typos
WenjieXiao-2022 May 4, 2024
16f0ed1
Update polytope_blmos.jl
WenjieXiao-2022 May 4, 2024
a6745a8
Update node.jl; test
WenjieXiao-2022 May 4, 2024
b6728b9
Update frank_wolfe_variants.jl;test
WenjieXiao-2022 May 4, 2024
7415887
Update polytope_blmos.jl
WenjieXiao-2022 May 5, 2024
a79c495
Update utilities.jl;
WenjieXiao-2022 May 5, 2024
6ec7f34
Update node.jl
WenjieXiao-2022 May 5, 2024
19cfd07
Update utilities.jl
WenjieXiao-2022 May 5, 2024
5a0d0be
Update polytope_blmos.jl
WenjieXiao-2022 May 5, 2024
f7a385b
Update polytope_blmos.jl;
WenjieXiao-2022 May 5, 2024
1c9c0af
Update frank_wolfe_variants.jl; testing
WenjieXiao-2022 May 5, 2024
e2b3673
Update frank_wolfe_variants.jl; testing
WenjieXiao-2022 May 5, 2024
02b788c
Update polytope_blmos.jl; testing
WenjieXiao-2022 May 5, 2024
15b2da6
Update polytope_blmos.jl;
WenjieXiao-2022 May 5, 2024
bef776b
Update polytope_blmos.jl
WenjieXiao-2022 May 6, 2024
fe96b04
Update polytope_blmos.jl
WenjieXiao-2022 May 6, 2024
3b72a5f
Update polytope_blmos.jl;
WenjieXiao-2022 May 6, 2024
e53f9f8
Update polytope_blmos.jl
WenjieXiao-2022 May 6, 2024
f2c3e4c
Update utilities.jl
WenjieXiao-2022 May 6, 2024
d22b8a7
Update node.jl
WenjieXiao-2022 May 7, 2024
cd191b5
Update node.jl
WenjieXiao-2022 May 7, 2024
d711b41
Update polytope_blmos.jl
WenjieXiao-2022 May 7, 2024
752e647
Update polytope_blmos.jl
WenjieXiao-2022 May 7, 2024
3a80ab1
Update node.jl
WenjieXiao-2022 May 7, 2024
ca70292
Update node.jl
WenjieXiao-2022 May 7, 2024
fa091c3
Update node.jl
WenjieXiao-2022 May 7, 2024
eb24df3
Update polytope_blmos.jl
WenjieXiao-2022 May 7, 2024
b1133e1
Update node.jl
WenjieXiao-2022 May 7, 2024
397dd85
Update node.jl
WenjieXiao-2022 May 7, 2024
9c0d94c
Update utilities.jl
WenjieXiao-2022 May 7, 2024
05a0082
Update node.jl
WenjieXiao-2022 May 7, 2024
fcef8ee
Update utilities.jl
WenjieXiao-2022 May 7, 2024
ce4888b
Update utilities.jl;
WenjieXiao-2022 May 7, 2024
d6909aa
Update node.jl
WenjieXiao-2022 May 7, 2024
0d7820d
Update node.jl
WenjieXiao-2022 May 7, 2024
ff57813
Update node.jl
WenjieXiao-2022 May 7, 2024
c6e62f6
Update utilities.jl
WenjieXiao-2022 May 7, 2024
56fc776
Update utilities.jl
WenjieXiao-2022 May 7, 2024
44b6ee5
Update utilities.jl
WenjieXiao-2022 May 7, 2024
30988ba
Update utilities.jl
WenjieXiao-2022 May 7, 2024
97cbf79
Update utilities.jl
WenjieXiao-2022 May 7, 2024
8ed2be6
Update utilities.jl
WenjieXiao-2022 May 7, 2024
38c79c7
Update polytope_blmos.jl;
WenjieXiao-2022 May 7, 2024
1f7ca99
Update utilities.jl
WenjieXiao-2022 May 7, 2024
46ea130
Update utilities.jl
WenjieXiao-2022 May 7, 2024
9643849
Update node.jl
WenjieXiao-2022 May 7, 2024
abac966
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 7, 2024
0cf25ee
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 7, 2024
e91da16
Update utilities.jl
WenjieXiao-2022 May 7, 2024
65c04a5
Update utilities.jl
WenjieXiao-2022 May 7, 2024
c69500d
Update utilities.jl
WenjieXiao-2022 May 7, 2024
80597e9
Update utilities.jl
WenjieXiao-2022 May 7, 2024
95d75c8
Update utilities.jl
WenjieXiao-2022 May 7, 2024
c8cfbc4
Update utilities.jl
WenjieXiao-2022 May 7, 2024
d5d0c89
Update node.jl
WenjieXiao-2022 May 9, 2024
eb31bbe
Update polytope_blmos.jl
WenjieXiao-2022 May 9, 2024
bd99592
Update utilities.jl
WenjieXiao-2022 May 9, 2024
8d13f5b
Update node.jl
WenjieXiao-2022 May 9, 2024
8b7b004
Update node.jl
WenjieXiao-2022 May 9, 2024
73f2683
Update utilities.jl
WenjieXiao-2022 May 9, 2024
67d48c0
Update node.jl
WenjieXiao-2022 May 9, 2024
652f1b6
Update utilities.jl
WenjieXiao-2022 May 9, 2024
65a6aaa
Update node.jl
WenjieXiao-2022 May 9, 2024
2618175
Update utilities.jl
WenjieXiao-2022 May 9, 2024
8f2b2f4
Update utilities.jl; test
WenjieXiao-2022 May 9, 2024
52b0695
Update utilities.jl
WenjieXiao-2022 May 9, 2024
3cdac5d
Update utilities.jl
WenjieXiao-2022 May 9, 2024
12231c6
Update utilities.jl
WenjieXiao-2022 May 9, 2024
f2add9a
Update node.jl
WenjieXiao-2022 May 9, 2024
9c2a438
Update utilities.jl
WenjieXiao-2022 May 9, 2024
c66b4cc
Update utilities.jl; tst
WenjieXiao-2022 May 9, 2024
c0ec4d9
Update utilities.jl; testing
WenjieXiao-2022 May 9, 2024
463b1b4
Update utilities.jl
WenjieXiao-2022 May 9, 2024
402a0e5
Update utilities.jl
WenjieXiao-2022 May 9, 2024
c0c2b6b
Update polytope_blmos.jl
WenjieXiao-2022 May 9, 2024
0df9272
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 9, 2024
b8f8581
Update node.jl
WenjieXiao-2022 May 9, 2024
8c59e15
Update polytope_blmos.jl
WenjieXiao-2022 May 11, 2024
aaf592a
Update node.jl
WenjieXiao-2022 May 11, 2024
447bb82
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
95bb632
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
95a450d
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
a2a7234
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
e873398
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
f21d347
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
ecc5c0a
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
fdf2e5b
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
e591f74
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
b3bf6a8
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
c58c73d
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
aee1ab5
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
f2ce733
Update polytope_blmos.jl
WenjieXiao-2022 May 12, 2024
45ca6e0
Update Boscia.jl
WenjieXiao-2022 May 15, 2024
2afc284
Update polytope_blmos.jl
WenjieXiao-2022 May 15, 2024
b858c05
Update polytope_blmos.jl
WenjieXiao-2022 May 15, 2024
fce5283
Update time_tracking_lmo.jl
WenjieXiao-2022 May 15, 2024
356f3e5
Update polytope_blmos.jl
WenjieXiao-2022 May 16, 2024
3eeee06
Update managed_blmo.jl; update dicg_split_active_set
WenjieXiao-2022 May 16, 2024
73cdbb5
Update node.jl
WenjieXiao-2022 May 16, 2024
8c08bb4
Update blmo_interface.jl
WenjieXiao-2022 May 16, 2024
a96625a
Update managed_blmo.jl
WenjieXiao-2022 May 16, 2024
798552e
Update node.jl
WenjieXiao-2022 May 16, 2024
d56886f
Update polytope_blmos.jl
WenjieXiao-2022 May 16, 2024
05591ad
Update polytope_blmos.jl
WenjieXiao-2022 May 16, 2024
eb9774e
Update time_tracking_lmo.jl
WenjieXiao-2022 May 25, 2024
e9ebbdf
Update polytope_blmos.jl
WenjieXiao-2022 May 25, 2024
dd028bc
Update frank_wolfe_variants.jl
WenjieXiao-2022 May 25, 2024
7b168ef
Update polytope_blmos.jl
WenjieXiao-2022 May 25, 2024
e368aaa
Update polytope_blmos.jl
WenjieXiao-2022 May 25, 2024
c81dce6
Update time_tracking_lmo.jl;
WenjieXiao-2022 May 25, 2024
c6f6ffa
Update polytope_blmos.jl
WenjieXiao-2022 May 25, 2024
2d40d6e
Update time_tracking_lmo.jl
WenjieXiao-2022 May 25, 2024
91d798c
Update MOI_bounded_oracle.jl;
WenjieXiao-2022 May 27, 2024
dc6f408
Update polytope_blmos.jl
WenjieXiao-2022 May 27, 2024
05dce7c
Update interface.jl;
WenjieXiao-2022 Jul 29, 2024
fae9ac6
Update node.jl
WenjieXiao-2022 Jul 29, 2024
e22ed4c
Update utilities.jl;
WenjieXiao-2022 Jul 29, 2024
eb5efa5
Update frank_wolfe_variants.jl
WenjieXiao-2022 Jul 29, 2024
b372d27
Update node.jl;
WenjieXiao-2022 Jul 30, 2024
144550a
Update frank_wolfe_variants.jl
WenjieXiao-2022 Jul 30, 2024
dfb42af
Update utilities.jl
WenjieXiao-2022 Aug 3, 2024
a0c5f44
Merge branch 'ZIB-IOL:main' into main
WenjieXiao-2022 Aug 21, 2024
d954f7a
Update MOI_bounded_oracle.jl
WenjieXiao-2022 Aug 21, 2024
f8f65dc
Add files via upload
WenjieXiao-2022 Aug 29, 2024
050cb48
Create examples
WenjieXiao-2022 Sep 25, 2024
95a7202
Add files via upload
WenjieXiao-2022 Sep 25, 2024
ad1bc5c
Add files via upload
WenjieXiao-2022 Sep 25, 2024
8550101
Merge branch 'ZIB-IOL:main' into main
WenjieXiao-2022 Sep 25, 2024
554cbcf
Update callbacks.jl
WenjieXiao-2022 Sep 25, 2024
33d36de
Update frank_wolfe_variants.jl
WenjieXiao-2022 Sep 25, 2024
575f429
Update interface.jl
WenjieXiao-2022 Sep 25, 2024
2e1e954
Update node.jl
WenjieXiao-2022 Sep 25, 2024
8a17168
Update polytope_blmos.jl
WenjieXiao-2022 Sep 25, 2024
6924c0a
Update callbacks.jl
WenjieXiao-2022 Sep 25, 2024
fecb6bd
Update time_tracking_lmo.jl
WenjieXiao-2022 Sep 25, 2024
e1f41f6
reconstruct callback
WenjieXiao-2022 Oct 22, 2024
25362a6
shorten some functions
WenjieXiao-2022 Oct 22, 2024
8eb32f5
added dicg start point related functions
WenjieXiao-2022 Oct 23, 2024
3e5e8ec
Update frank_wolfe_variants.jl
WenjieXiao-2022 Oct 23, 2024
b5daada
Add files via upload
WenjieXiao-2022 Oct 23, 2024
c82e200
Merge branch 'ZIB-IOL:main' into main
WenjieXiao-2022 Oct 24, 2024
a16dcea
Merge branch 'ZIB-IOL:main' into main
WenjieXiao-2022 Oct 27, 2024
c576225
corrected the arguments
WenjieXiao-2022 Dec 4, 2024
0493cd3
corrected the arguments
WenjieXiao-2022 Dec 4, 2024
1a1688d
typo
WenjieXiao-2022 Dec 4, 2024
03a86fc
typo
WenjieXiao-2022 Dec 4, 2024
7eb4969
resolved conflicts
WenjieXiao-2022 Dec 4, 2024
d0e8bf0
resolved conflicts
WenjieXiao-2022 Dec 4, 2024
4e30f4e
resolved conflicts
WenjieXiao-2022 Dec 4, 2024
e7193d4
resolved conflicts
WenjieXiao-2022 Dec 4, 2024
840feaf
Update node.jl
WenjieXiao-2022 Dec 4, 2024
88f9248
resolved conflicts
WenjieXiao-2022 Dec 4, 2024
3e1fb39
Merge branch 'ZIB-IOL:main' into main
WenjieXiao-2022 Dec 4, 2024
563a995
in-face check for pre_computed_set
WenjieXiao-2022 Dec 4, 2024
82673b6
specify sanity check for non-DICG
WenjieXiao-2022 Dec 4, 2024
b148003
run with DICG()
WenjieXiao-2022 Dec 13, 2024
573f447
using seed 5
WenjieXiao-2022 Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/experiments/examples
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
read
Binary file added examples/experiments/src_birkhoff.7z
Binary file not shown.
Binary file added examples/experiments/src_birkhoff.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions src/Boscia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ module Boscia
using FrankWolfe
import FrankWolfe: compute_extreme_point
export compute_extreme_point
import FrankWolfe: is_decomposition_invariant_oracle
export is_decomposition_invariant_oracle

import FrankWolfe: compute_inface_extreme_point
export compute_inface_extreme_point

import FrankWolfe: dicg_maximum_step
export dicg_maximum_step
using Random
import Bonobo
using Printf
Expand Down
72 changes: 68 additions & 4 deletions src/MOI_bounded_oracle.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
"""
BoundedLinearMinimizationOracle for solvers supporting MathOptInterface.
"""

# Store extra information of solving inface extrem points.
# The keys of MOI_attribute should correspond to specific MOI_attribute names.
mutable struct Inface_point_solve_data
MOI_attribute::Dict
function Inface_point_solve_data()
MOI_attribute = Dict()
return new(MOI_attribute)
end
end

struct MathOptBLMO{OT<:MOI.AbstractOptimizer} <: BoundedLinearMinimizationOracle
o::OT
use_modify::Bool
inface_point_solve_data::Inface_point_solve_data
function MathOptBLMO(o, use_modify=true)
MOI.set(o, MOI.ObjectiveSense(), MOI.MIN_SENSE)
return new{typeof(o)}(o, use_modify)
inface_point_solve_data = Inface_point_solve_data()
return new{typeof(o)}(o, use_modify, inface_point_solve_data)
end
end

Expand Down Expand Up @@ -342,9 +355,16 @@ end
Get solve time, number of nodes and number of simplex iterations.
"""
function get_BLMO_solve_data(blmo::MathOptBLMO)
opt_times = MOI.get(blmo.o, MOI.SolveTimeSec())
numberofnodes = MOI.get(blmo.o, MOI.NodeCount())
simplex_iterations = MOI.get(blmo.o, MOI.SimplexIterations())
if !isempty(blmo.inface_point_solve_data.MOI_attribute)
opt_times = blmo.inface_point_solve_data.MOI_attribute[MOI.SolveTimeSec()]
numberofnodes = blmo.inface_point_solve_data.MOI_attribute[MOI.NodeCount()]
simplex_iterations = blmo.inface_point_solve_data.MOI_attribute[MOI.SimplexIterations()]
empty!(blmo.inface_point_solve_data.MOI_attribute)
else
opt_times = MOI.get(blmo.o, MOI.SolveTimeSec())
numberofnodes = MOI.get(blmo.o, MOI.NodeCount())
simplex_iterations = MOI.get(blmo.o, MOI.SimplexIterations())
end
return opt_times, numberofnodes, simplex_iterations
end

Expand Down Expand Up @@ -599,6 +619,50 @@ function Bonobo.get_branching_variable(
return max_idx
end


function is_decomposition_invariant_oracle(blmo::MathOptBLMO)
true
end

function compute_inface_extreme_point(blmo::MathOptBLMO, direction, x; kwargs...)
MOI_attribute = Dict()
MOI_attribute[MOI.SolveTimeSec()] = 0.0
MOI_attribute[MOI.NodeCount()] = 0.0
MOI_attribute[MOI.SimplexIterations()] = 0.0
blmo.inface_point_solve_data.MOI_attribute = MOI_attribute
lmo = convert(FrankWolfe.MathOptLMO, blmo)
a = FrankWolfe.compute_inface_extreme_point(lmo,
direction,
x;
solve_data=blmo.inface_point_solve_data.MOI_attribute,
kwargs,
)
@assert blmo isa MathOptBLMO
return a
end

function dicg_maximum_step(blmo::MathOptBLMO, x, direction; kwargs...)
lmo = convert(FrankWolfe.MathOptLMO, blmo)
return FrankWolfe.dicg_maximum_step(
lmo,
x,
direction;
kwargs...,
)
end

# Provide specific active_set split method for MathOptBLMO in DICG.
function dicg_split_vertices_set!(blmo::MathOptBLMO, active_set::FrankWolfe.ActiveSet{T,R}, tree, vidx::Int;kwargs...)where {T,R}
x = FrankWolfe.get_active_set_iterate(active_set)
x0_left = copy(x)
x0_right = copy(x)
x0_left[vidx] = floor(x[vidx])
x0_right[vidx] = ceil(x[vidx])
as_left = FrankWolfe.ActiveSet([(1.0, x0_left)])
as_right = FrankWolfe.ActiveSet([(1.0, x0_right)])
return as_left, as_right
end

"""
Solve function in case of MathOptLMO.
Converts the lmo into a MathOptBLMO and calls the solve function below.
Expand Down
7 changes: 7 additions & 0 deletions src/blmo_interface.jl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add the other DICG functions as well. They can have some default behaviour, i.e. throw an error that this is not implemented yet.

Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ function get_variables_pointers(blmo::BoundedLinearMinimizationOracle, tree)
return collect(1:N)
end

"""
Given split variable index, return corresponding active sets for DICG as a warm start.
"""
function dicg_split_vertices_set!(blmo::BoundedLinearMinimizationOracle, active_set::FrankWolfe.ActiveSet{T,R}, tree, vidx::Int;kwargs...)where {T,R}
error("Not implemented yet")
end


## Logs
"""
Expand Down
188 changes: 132 additions & 56 deletions src/callbacks.jl
WenjieXiao-2022 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -13,82 +13,158 @@ function build_FW_callback(
fw_iterations,
min_fw_iterations,
time_ref,
time_limit,
time_limit;
use_DICG=false,
)
vars = get_variables_pointers(tree.root.problem.tlmo.blmo, tree)
# variable to only fetch heuristics when the counter increases
ncalls = -1
return function fw_callback(state, active_set, kwargs...)
@assert isapprox(sum(active_set.weights), 1.0)
@assert sum(active_set.weights .< 0) == 0
# TODO deal with vertices becoming infeasible with conflicts
@debug begin
if !is_linear_feasible(tree.root.problem.tlmo, state.v)
@info "$(state.v)"
check_infeasible_vertex(tree.root.problem.tlmo.blmo, tree)
@assert is_linear_feasible(tree.root.problem.tlmo, state.v)
end
if state.step_type != FrankWolfe.ST_SIMPLEXDESCENT && !is_integer_feasible(tree, state.v)
@info "Vertex not integer feasible! Here are the integer variables: $(state.v[tree.root.problem.integer_variables])"
@assert is_integer_feasible(tree, state.v)
end
end
push!(fw_iterations, state.t)
if !use_DICG
return function fw_callback(state, active_set, kwargs...)
@assert isapprox(sum(active_set.weights), 1.0)
@assert sum(active_set.weights .< 0) == 0
# TODO deal with vertices becoming infeasible with conflicts
@debug begin
if !is_linear_feasible(tree.root.problem.tlmo, state.v)
@info "$(state.v)"
check_infeasible_vertex(tree.root.problem.tlmo.blmo, tree)
@assert is_linear_feasible(tree.root.problem.tlmo, state.v)
end
if state.step_type != FrankWolfe.ST_SIMPLEXDESCENT && !is_integer_feasible(tree, state.v)
@info "Vertex not integer feasible! Here are the integer variables: $(state.v[tree.root.problem.integer_variables])"
@assert is_integer_feasible(tree, state.v)
end
end
push!(fw_iterations, state.t)

if state.lmo !== nothing # can happen with using Blended Conditional Gradient
if ncalls != state.lmo.ncalls
ncalls = state.lmo.ncalls
(best_v, best_val) = find_best_solution(
tree.root.problem.f,
tree.root.problem.tlmo.blmo,
vars,
tree.root.options[:domain_oracle],
)
if best_val < tree.incumbent
if state.lmo !== nothing # can happen with using Blended Conditional Gradient
if ncalls != state.lmo.ncalls
ncalls = state.lmo.ncalls
(best_v, best_val) = find_best_solution(
tree.root.problem.f,
tree.root.problem.tlmo.blmo,
vars,
tree.root.options[:domain_oracle],
)
if best_val < tree.incumbent
node = tree.nodes[tree.root.current_node_id[]]
add_new_solution!(tree, node, best_val, best_v, :Solver)
Bonobo.bound!(tree, node.id)
end
end
end

if (state.primal - state.dual_gap > tree.incumbent + 1e-2) &&
tree.num_nodes != 1 &&
state.t > min_fw_iterations
return false
end

if tree.root.options[:domain_oracle](state.v) && state.step_type != FrankWolfe.ST_SIMPLEXDESCENT
val = tree.root.problem.f(state.v)
if val < tree.incumbent
#TODO: update solution without adding node
node = tree.nodes[tree.root.current_node_id[]]
add_new_solution!(tree, node, best_val, best_v, :Solver)
add_new_solution!(tree, node, val, copy(state.v), :vertex)
Bonobo.bound!(tree, node.id)
end
end
end

if (state.primal - state.dual_gap > tree.incumbent + 1e-2) &&
tree.num_nodes != 1 &&
state.t > min_fw_iterations
return false
end
WenjieXiao-2022 marked this conversation as resolved.
Show resolved Hide resolved
node = tree.nodes[tree.root.current_node_id[]]
if length(node.active_set) > 1 &&
!isempty(tree.nodes) &&
min_number_lower <= length(values(tree.nodes))
counter = 0
for n in values(tree.nodes)
if n.lb < val
counter += 1
end
if counter > min_number_lower
return false
end
end
end

if tree.root.options[:domain_oracle](state.v) && state.step_type != FrankWolfe.ST_SIMPLEXDESCENT
val = tree.root.problem.f(state.v)
if val < tree.incumbent
#TODO: update solution without adding node
node = tree.nodes[tree.root.current_node_id[]]
add_new_solution!(tree, node, val, copy(state.v), :vertex)
Bonobo.bound!(tree, node.id)
# check for time limit
if isfinite(time_limit) && Dates.now() >= time_ref + Dates.Second(time_limit)
return false
end

return true
end
else
return function (state, kwargs...)
# TODO deal with vertices becoming infeasible with conflicts
@debug begin
if !is_linear_feasible(tree.root.problem.tlmo, state.v)
@info "$(state.v)"
check_infeasible_vertex(tree.root.problem.tlmo.blmo, tree)
@assert is_linear_feasible(tree.root.problem.tlmo, state.v)
end
if state.step_type != FrankWolfe.ST_SIMPLEXDESCENT && !is_integer_feasible(tree, state.v)
@info "Vertex not integer feasible! Here are the integer variables: $(state.v[tree.root.problem.integer_variables])"
@assert is_integer_feasible(tree, state.v)
end
end
push!(fw_iterations, state.t)

node = tree.nodes[tree.root.current_node_id[]]
if length(node.active_set) > 1 &&
!isempty(tree.nodes) &&
min_number_lower <= length(values(tree.nodes))
counter = 0
for n in values(tree.nodes)
if n.lb < val
counter += 1
if state.lmo !== nothing # can happen with using Blended Conditional Gradient
if ncalls != state.lmo.ncalls
ncalls = state.lmo.ncalls
(best_v, best_val) = find_best_solution(
tree.root.problem.f,
tree.root.problem.tlmo.blmo,
vars,
tree.root.options[:domain_oracle],
)
if best_val < tree.incumbent
node = tree.nodes[tree.root.current_node_id[]]
add_new_solution!(tree, node, best_val, best_v, :Solver)
Bonobo.bound!(tree, node.id)
end
end
if counter > min_number_lower
return false
end

if (state.primal - state.dual_gap > tree.incumbent + 1e-2) &&
tree.num_nodes != 1 &&
state.t > min_fw_iterations
return false
end

if tree.root.options[:domain_oracle](state.v)
val = tree.root.problem.f(state.v)
if val < tree.incumbent
#TODO: update solution without adding node
node = tree.nodes[tree.root.current_node_id[]]
add_new_solution!(tree, node, val, copy(state.v), :vertex)
Bonobo.bound!(tree, node.id)
end
end

node = tree.nodes[tree.root.current_node_id[]]
if length(node.active_set) > 1 &&
!isempty(tree.nodes) &&
min_number_lower <= length(values(tree.nodes))
counter = 0
for n in values(tree.nodes)
if n.lb < val
counter += 1
end
if counter > min_number_lower
return false
end
end
end
end

# check for time limit
if isfinite(time_limit) && Dates.now() >= time_ref + Dates.Second(time_limit)
return false
# check for time limit
if isfinite(time_limit) && Dates.now() >= time_ref + Dates.Second(time_limit)
return false
end

return true
end

return true
WenjieXiao-2022 marked this conversation as resolved.
Show resolved Hide resolved

end
end

Expand Down
Loading