Is there a way to adapt the method of Lagrange multipliers to problems involving discrete variables? Unfortunately I don't have a specific problem to ask here (I haven't completely formulated it yet), but I do know that in this hypothetical problem the variables involved will have to be binary values. Thanks for any references or tips!
Edit: Here's an example of the type of problem I'm interested in solving. Given $ \sum_{i=1}^{n} A_nx_n$ for any $B \in R$ and $A_n \in R$ I want to find the sequence of $x_n$s that minimizes the squared error $[(\sum_{i=1}^{n} A_nx_n) - B]^2$ given arbitrary weights $A_n$, with the constraint that each $x_n$ can be binary valued (1 or 0).
Obviously if N is small I could just test every sequence, but if not?