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

alg: include weighted costs in the optimization function #117

Closed
armfazh opened this issue Oct 8, 2021 · 2 comments
Closed

alg: include weighted costs in the optimization function #117

armfazh opened this issue Oct 8, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@armfazh
Copy link

armfazh commented Oct 8, 2021

addchain optimizes for the minimum of M+S.
However, this assumes the cost of M and S are equal.

It's common the rate S/M varies depending on the field.

| Example | S=M | S=0.8M | S=0.6 M | 
| 3M + 2S | 5.0 |  5.6   |  4.2    |
| 4M + 1S | 5.0 |  4.8   |  4.6    |

The feature request is allow the user to specify the cost of operations.

@armfazh armfazh changed the title include weighted costs in the optimization function alg: include weighted costs in the optimization function Oct 8, 2021
@mmcloughlin
Copy link
Owner

Yeah, this is a good call, thanks for the feature request. I'll close this because #55 already covers it.

@mmcloughlin mmcloughlin added the duplicate This issue or pull request already exists label Oct 9, 2021
mmcloughlin added a commit that referenced this issue Oct 9, 2021
Doubling (squaring) is typically cheaper than addition (multiplication). This
PR adds options to the search subcommand to score addition chains based on a
weighted sum.

Closes #55
Updates #117
@mmcloughlin
Copy link
Owner

Just landed #120, which is just about the simplest thing I could do to support this. Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants