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

Simulated annealing for LP heuristics #41

Conversation

panagiotisrep
Copy link
Contributor

On previous pull request I implemented the simulated annealing algorithm for convex optimization from Kalai and Vempala, “Simulated Annealing for Convex Optimization.” for polytopes (linear optimization).
Now I test new heuristics and implement a more efficient version.

More info on implementation / testing here.

…std::vector. Made required code updates in polytopes.h, rounding.h,ballintersectconvex.h and updated CMakeLists.txt to include the directory with Eigen.
…plane method, in file "cutting_plane.h". I also added the new test "opt_cutting_plane.cpp"
…n interior_point.h, created lp_generator.h and generate_lp.cpp to create tests. In eigen unsupported changed Macros.h so instead of assert it throws exceptions.
Most of the code is refactored. Remove from external libraries unwanted dependencies and make necessary changes so that efficiency is maximized and avoid duplicate operations. In particular:

- minimal inclusion for Eigen Unsupported: keep only what is required for square root of matrix

- /include/generators/lp_generator.h creates lp tests

- /include/optimization/lp_problem.h is the class that handles linear problems

- /include/optimization/cutting_plane.h holds the two randomized cutting plane algorithms (with and without implicit isotropization)

- /include/samplers/samplers.h deleted some functions

- /test/opt_cutting_plane.cpp make appropriate changes when calling new functions
- /include/convex_bodies/polytopes.h add a new function that does ray shooting and also returns the facets the ray hits

- /include/optimization/cutting_plane.h implemented the following heuristics: at each phase sample 1 point and cut the polytope, as an escape step try to move to the center of the Chebyshev ball or use the billiard walk
- /include/convex_bodies/spectrahedron.h the class which will hold the linear matrix inequality describing a spectrahedron

- /include/optimization/cutting_plane_sdp.h the randomized cutting plane method coded for spectrahedra

- /include/optimization/sdp_problem.h The class which will manage the SDP optimization problem

- /include/samplers/samplers.h added functions for hit and run sor spectrahedra

- /tests/opt_cutting_plane_sdp.cpp the main which will be used to test the new algorithm implementation

- /tests/CMakeLists.txt added the new executable opt_cutting_plane_sdp
- /include/convex_bodies/spectrahedron.h changed constructor
- /include/optimization/sdp_problem add method to read from file
- /include/convex_bodies/spectrahedron.h added boundary oracle
- /include/optimization/cutting_plane_sdp.h implemented randomized cutting plane algorithm for sdp
- /include/sdp_problem.h transform lp to sdp, solve sdp methods
- /include/test/opt_cutting_plane_sdp.cpp a test main to test the algorithm
- /include/convex_bodies/spectrahedron.h added boundary oracle
- /include/optimization/cutting_plane_sdp.h implemented randomized cutting plane algorithm for sdp
- /include/sdp_problem.h transform lp to sdp, solve sdp methods
- /include/test/opt_cutting_plane_sdp.cpp a test main to test the algorithm
- /include/convex_bodies/spectrahedron.h added method for checking positive/negative definiteness
- /include/generators/sdp_generator.h creates sdp problems
- /include/optimization/interior_point_sdp.h finds a strictly feasible point in a spcectrahedron
- /include/sdp_problem.h edit it to find a initial point to pass it to cutting plane method
- /include/test/generate_sdp.cpp a main to create tests for SDP
- /include/convex_bodies/spectrahedron.h add method to check if matrix is singular
- /include/samplers/samplers.h edit hit & run to use sample covariance matrix heuristic
- /include/optimization/cutting_plane_sdp.h implemented randomized cutting plane algorithm with sample covariance matrix heuristic
- /include/sdp_problem.h select to use sample covariance matrix heuristic or not
- /include/test/opt_cutting_plane_sdp.cpp a test main to test the algorithm
A simple implementation to read and export SDP programs in SDPA format. In this version only comments at the beginning and then numbers are allowed, no brackets, commas or parentheses.

- /include/optimization/SDPA_format_manager.h functions to export/import SDPA format files
- /include/sdp_problem.h methods to read/write files in SDPA format
- /include/test/opt_cutting_plane_sdp.cpp edit the test main to read SDPA format files
Implementation of the sampled covariance matrix heuristic for LPs. The implementation was already in file cutting_plane_sdp.h, so it just needed to be moved to a new file.

- /include/optimization/cutting_plane_sdp.h moved away the implementation of the heuristic
- /include/optimization/heuristics.h the implementation of the heuristic is here
- /include/optimization/cutting_plane.h a previous version of this heuristic was already implemented for LPs. Deleted the previous one and edited to use the new version
- /include/lp_problem.h edit to use the heuristic if prompted
- /include/test/opt_cutting_plane.cpp edit the test main to use the heuristic if prompted by user
Implementation of a deterministic cutting plane method. At each step, the polytope is cut at the approximated Chebyshev center.

- /include/optimization/cutting_plane.h add deterministic cutting plane method
- /include/lp_problem.h edit to use the new algorithm
- /include/test/opt_cutting_plane.cpp edit the test main to use the new algorithm
Correction in sdp_generator.h - the tests created were wrong
- /include/convex_bodies/spectrahedron.h added methods to check if the matrix from evaluating a LMI is singular
- /include/optimization/cutting_plane_sdp.h changed stopping criterion
- /test/generate_sdp.cpp edit it to produce problems in SDPA format
Edit the deterministic cutting plane algorithm to cut the polytope a bit further from the point returned as Chebyshev center, so there won't be instability
Implementation of simulation annealing for convex optimization

- /include/convex_bodies/polytopes.h add method to calculate the distances from closest/farthest point from given point
- /include/optimization/lp_problem.h add the option to use simulated annealing to solve LP problems
- /include/optimization/simulated_annealing.h the implementation of the algorithm
- /include/optimization/truncated_exponential.h implement a method to sample from the truncated exponential distribution
- /include/samplers/samplers.h add methods to use hit and run to sample w.r.t. the Boltzmann distribution
- /test/opt_cutting_plane.cpp add the option to use simulated annealing to solve LP problems
in simulated annealing for the objective function c, it must hold |c|=1
Added two heuristics for the simulated annealing algorithm, the set directions heuristic and a more efficient computation of the covariance matrix.

- include/optimization/lp_problem.h edit to choose the new heuristics
- include/optimization/simulated_annealing.h the implementations of the heuristics
- test/opt_cutting_plane.cpp edit to choose the new heuristics
Added a sliding window of size 100 + d^{2.5} to determine when to stop the random walk.

- include/optimization/simulated_annealing.h edit the walk length
@vissarion vissarion changed the title Simulated annealing heuristics Simulated annealing for LP heuristics Feb 19, 2020
@vissarion vissarion force-pushed the develop branch 4 times, most recently from a723d21 to 9b01ec6 Compare February 27, 2020 13:27
@vissarion vissarion force-pushed the develop branch 7 times, most recently from e4ac563 to ca784f5 Compare February 27, 2020 15:06
@vissarion
Copy link
Member

A more efficient algorithm is implemented here #42 making this PR redundant.

@vissarion vissarion closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants