Skip to content

Add Logic-Based Discrete-Steepest Descent Algorithm in GDPOpt#3331

Merged
blnicho merged 57 commits intoPyomo:mainfrom
ZedongPeng:dsda_dev
Feb 20, 2025
Merged

Add Logic-Based Discrete-Steepest Descent Algorithm in GDPOpt#3331
blnicho merged 57 commits intoPyomo:mainfrom
ZedongPeng:dsda_dev

Conversation

@ZedongPeng
Copy link
Copy Markdown
Contributor

Summary/Motivation:

This PR introduces the implementation of the Logic-Based Discrete Steepest Descent algorithm in GDPOpt.

The Logic-based Discrete-Steepest Descent Algorithm (LD-SDA) is a solution method for GDP problems involving ordered Boolean variables. The LD-SDA reformulates these ordered Boolean variables into integer decisions called external variables. The LD-SDA solves the reformulated GDP problem using a two-level decomposition approach where the upper-level subproblem determines external variable configurations. Subsequently, the remaining continuous and discrete variables are solved as a subproblem only involving those constraints relevant to the given external variable arrangement, effectively taking advantage of the structure of the GDP problem.

More details in the paper https://arxiv.org/abs/2405.05358 .

@emma58 @bernalde

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 92.78846% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.64%. Comparing base (5f522f3) to head (ea99c90).
Report is 800 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/gdpopt/ldsda.py 92.34% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3331      +/-   ##
==========================================
+ Coverage   88.62%   88.64%   +0.01%     
==========================================
  Files         880      881       +1     
  Lines      100661   100868     +207     
==========================================
+ Hits        89214    89412     +198     
- Misses      11447    11456       +9     
Flag Coverage Δ
linux 86.07% <26.92%> (-0.13%) ⬇️
osx 76.10% <26.92%> (-0.11%) ⬇️
other 86.60% <26.92%> (-0.12%) ⬇️
win 84.55% <26.92%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ZedongPeng
Copy link
Copy Markdown
Contributor Author

I will add tests to increase the code coverage.

@blnicho blnicho changed the title Add Logic-Based Discrete-Steepest Descent Algorithm in GDPOpt [WIP] Add Logic-Based Discrete-Steepest Descent Algorithm in GDPOpt Oct 1, 2024
@ZedongPeng
Copy link
Copy Markdown
Contributor Author

Hi @dovallev and @David-Linan,

This PR includes a general implementation of LDSDA. When you have some time, could you please review it? Thanks in advance!

@ZedongPeng
Copy link
Copy Markdown
Contributor Author

Hi @blnicho . I have resolved all the comments and the PR is ready for Jenkins tests and your review again.
Thank you for reviewing it.

Copy link
Copy Markdown
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

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

Sorry for the long-delayed review. A bunch of comments, most of which are minor, but I would recommend changing from the config arguments being component names to being the components themselves. I think it will be much safer and simpler, and it will allow you to validate them using the config infrastructure.

Comment on lines +147 to +148
if self.any_termination_criterion_met(config):
break
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor nit, but it shouldn't be hard to add a test that exercises this--if you just choose a problem that needs more than one iteration and set a smaller iteration limit, for example.

],
time_limit=100,
)
self.assertAlmostEqual(value(model.obj), -23.305325, places=4)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be hard to check the solution (or at least the discrete part) too?

@mrmundt
Copy link
Copy Markdown
Contributor

mrmundt commented Feb 19, 2025

@ZedongPeng - the failures in doctests aren't your fault; the new sphinx version exposed an upstream bug. Nothing to do with your code.

@ZedongPeng
Copy link
Copy Markdown
Contributor Author

Hi @emma58 . I have fixed most of your comments and it's ready for your second review now. Many thanks.

@blnicho blnicho merged commit 2367e85 into Pyomo:main Feb 20, 2025
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants