mip-meal-allocation

command
v0.24.2-dev.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Nextmv mip-meal-allocation template

This template demonstrates how to solve a Mixed Integer Programming problem using the open-source solver HiGHS.

To solve a Mixed Integer Problem (MIP) is to optimize a linear objective function of many variables, subject to linear constraints. We demonstrate this by solving a made up problem we named MIP meal allocation.

MIP meal allocation is a demo program in which we maximize the number of binkies our bunnies will execute by selecting their meal.

A binky is when a bunny jumps straight up and quickly twists its hind end, head, or both. A bunny may binky because it is feeling happy or safe in its environment.

The input defines a number of meals we can use to maximize binkies. Each meal consists out of one or more items and in total we can only use the number of items we have in stock.

The most important files created are main.go and input.json.

  • main.go implements a binkies MIP solver.
  • input.json is a sample input file that follows the input definition in main.go.

Before you start customizing, run the command below to see if everything works as expected:

nextmv sdk run . -- -runner.input.path input.json \
  -runner.output.path output.json -limits.duration 10s

A file output.json should have been created with the optimal binkies solution

Next steps

Documentation

Overview

package main holds the implementation of the mip-meal-allocation template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL