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

DCP Compliant formation #14

Closed
talipini opened this issue Aug 16, 2022 · 1 comment
Closed

DCP Compliant formation #14

talipini opened this issue Aug 16, 2022 · 1 comment

Comments

@talipini
Copy link

Newbie here. Appreciate any insights. I am trying to create a DCP complaint structure. I am trying to create a constraint and minimization that looks at the combination of the valid items selected and the corresponding weights. I understand using the product is not compliant and I was wondering if there is a better way to express this. Appreciate any insights

Specifically, constraint such as


	# cp.sum(cp.multiply(valid_items,wts)) == 1.0 <----- Non DCP compliant product

And minimization object such as


    	obj = cp.Minimize(cp.quad_form(wts @ valid_items - base_wts, cov)) <----- Non DCP compliant product

Psuedo Code:

    valid_items = cp.Variable(shape=200, boolean=True)
    wts = cp.Variable(shape=200), nonneg=True)

    # Create two constraints.
    constraints = [
                    cp.sum(valid_items) >=98,
                    cp.sum(valid_items) <=100,
                    # cp.sum(cp.multiply(valid_items,wts)) == 1.0 <----- Non DCP compliant product
                    wts <= 0.2,
                    wts >= 0.0005,
                ]

    obj = cp.Minimize(cp.quad_form(wts @ valid_items - base_wts, cov)) <----- Non DCP compliant product
    
    ....
@mcg1969
Copy link
Member

mcg1969 commented Apr 13, 2024

Sorry that nobody ever responded to this; we don't look at this repo much. For the benefit of others who come here, please visit https://ask.cvxr.com/ for questions about DCP.

@mcg1969 mcg1969 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
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

No branches or pull requests

2 participants