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

Performance improvements by not calculating when not needed #35

Open
halcwb opened this issue Nov 20, 2021 · 3 comments
Open

Performance improvements by not calculating when not needed #35

halcwb opened this issue Nov 20, 2021 · 3 comments
Assignees
Labels
idea just a thought that might work

Comments

@halcwb
Copy link
Contributor

halcwb commented Nov 20, 2021

Is your feature request related to a problem? Please describe.
What if GenSolver is able to figure out which changes in variables need calculation and which changes in variables do not need calculation and just sets them? GenOrder will already first create a list of constraints and only then gives those to the solver.

Describe the solution you'd like
Now the solver will try to order the constraints in the most effective way, but still does the calculations.

@kerimdelic. I think this needs a graph like solution? To check which variables that have to be changed are related to which? Then first set all unrelated variables without any calculation.

@halcwb halcwb changed the title Performance improvements Performance improvements by not calculating when not needed Nov 20, 2021
@halcwb halcwb added the idea just a thought that might work label Nov 20, 2021
@kerimdelic
Copy link
Collaborator

@halcwb I have an idea, but this is for specific cases and does not use graphs. I have studied the logbook of paracetamol. There is a way to do a preprocessing step. Before we even start calculating, we can conclude if a variable will change. In the paracetamol example, we have only product equations. Suppose that we apply the constraint given in this picture below. So, paracetamol.Adjust.Qty: MinInclProp 250N NoLimit apply to 1.paracetamol.Adjust.Qty.

As it can be seen in the picture, we currently solve 4 equations and calculate whether the domains of the other two variables of an equation need to be changed. However, none of the other variables are changed. The reason why is as follows: If we have an equation y = x*z, and x has been restricted by [250N ... > (or some other domain), and if we know that y and z have the default domain of <0 ...>, then we don't have to do any calculations. Especially in the beginning, a lot of this equation type is being solved (I have found at least 50 in the 'simple' paracetamol example). But if we implement an if statement to check whether the other two variables of the equation have the default domain, then we can immediately say that the other two variables will stay unchanged and do not need to calculate. This could give us a slight improvement. And this is just a special case, but it could be that we can find an even stronger rule or explore graphs as you mentioned.
image

@halcwb
Copy link
Contributor Author

halcwb commented Dec 17, 2021

@kerimdelic I am closing this as this lead to nowhere.

@halcwb halcwb closed this as completed Dec 17, 2021
@halcwb
Copy link
Contributor Author

halcwb commented Dec 17, 2021

@kerimdelic Sorry, maybe keep this open. I thought this was about something else.

@halcwb halcwb reopened this Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea just a thought that might work
Projects
None yet
Development

No branches or pull requests

2 participants