I am trying to model a market with multiple goods, with multiple sellers and buyers offering a price for one or more goods. It is allowed for a seller who for example is selling 6 apples to sell 2 to a buyer offering the highest price and 4 to the buyer offering a slightly worse price. The market place also needs to support conditional offers, i.e. I want to sell 4 apples but only if I can buy 2 pears.
I have modeled this a few ways now using Google OR-Tools, but the closest way of solving it I can find is using CP-SAT, however it's not immediately obvious to me how to model the conditional offers.
What is the best way of modelling a market place like this?
You should have a look at:
https://github.com/google/or-tools/blob/stable/ortools/sat/doc/channeling.md
The main idea is that you can attach Boolean literals to some properties of variables. Then you can use standard Boolean logic to link these literals together.