I want an interesting synonym To describe this thing That you say we're all grandfathered in I'll use the search engine (we've got much to discuss) Too much to discuss Over a bucket of balls I can recall the glow of your low beams It's the big night in Tinsel City Life became a spectator sport I launch my fragrance called "Integrity" I sell the fact that I can't be bought Have I told you all about the time That I got sucked into a hole through a hand held device? I will flashback now and again but I'm usually alright Thankfully the process has been simplified Since the last time you tried -- Alex Turner
Nextmv offers a comprehensive set of tools for solving Mixed Integer Programs (MIP). To get started with MIP you have two alternatives:
- Marketplace app: work with a ready-to-use solution.
- Platform: get access to a fully customizable solution.
After familiarizing yourself with the two alternatives, please continue with these next steps:
- Explore examples for more complex problems.
Marketplace app
Subscribe to our newsletter to be the first to hear when MIP becomes a marketplace app! ๐ก
Platform
Please make sure you already completed the steps described in the 5-minute getting started experience.
To test that the Nextmv CLI is correctly configured, please run the following command on your terminal. It will get some files that are necessary to work with the Nextmv Platform. You can see the expected output as well.
To get started with MIP, consider the knapsack problem, which is a classical example of a MIP:
Given a set of items, each with a weight and a value, determine which items to include in the collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
This problem can be formulated as follows:
Where:
I
is the set of items.v_i
is the value of itemi in I
.w_i
is the weight of itemi in I
.W
is the capacity of the knapsack.x_i
is a binary variable that takes value1
if itemi in I
is selected, and0
otherwise.
Get started by initializing the mip
template:
Change directories into the mip
folder.
You should see the input.json
and main.go
files, similar to these ones:
Run the code, specifying the file to be used as input, and the file to be used as output, along with other options.
After running, an output.json
file should have been created with the solution, similar to this one:
In general, the steps to solve a MIP are:
- Create a
Model
. - Add
Variables
to the model, by calling methods on theModel
directly. - Set the
Objective
of the model, and the sense (max or min), by calling methods on theModel
directly. - Add
Constraints
to the model, by calling methods on theModel
directly. For eachConstraint
, you define the sense, the right hand side and add terms to it. - Solve the MIP defined in the
Model
by using aSolver
.
These are the supported solvers for Mixed Integer Programming (MIP):
Provider | Description | Use with |
---|---|---|
HiGHS | Open-source solver. | Nextmv platform & SDK |
FICO Xpress | Commercial solver. | Nextmv platform & SDK |
OR-Tools | Open-source solver. | Nextmv platform & Python |
Please note that HiGHS is used as the default solver provider. To use a different one, please visit the supported solvers page to learn more about working with different providers.
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
You are all set to keep exploring!
Here are the next steps to continue your journey:
- Deploy your app to Nextmv Cloud.
- Take a deeper look at the supported solvers.
- Explore more examples of solving MIP problems.
- Meal allocation: allocate meals to bunnies to maximize binkies.
- Incentive allocation: allocate discounts to users while not exceeding a budget.