Hub
Pricing About
ComponentComponent

Optimization

LPMIPMILPOptimizationLinear program
carstenhaubold profile image
Draft Latest edits on 
Jul 24, 2024 2:35 PM
Drag & drop
Like
Use or download

This component solves linear programs (LP) and mixed-integer linear programs (MILP) using the optimization tools provided in Python's scipy package.

The objective function that is minimized by this component is variables * weights subject to a list of constraints.

The first input table must specify all variables of the optimization problem, their objective function weights, upper and lower bounds, as well as whether the variable must take on integral values. If at least one variable is required to be integral, the problem turns into a MILP and will be solved with the scipy MILP solver (https://docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.optimize.milp.html). Otherwise it will be solved scipy's linear program solver (https://docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.optimize.linprog.html#scipy.optimize.linprog)

The second input table defines the constraints of this optimization problem, given as upper bounds or equality constraints. Constraints are specified by a coefficient for each variable and a constraining value. For equality constraints this means the solution must satisfy variable coefficient = constraint, where for upper bounds this is in turn variable * coefficient <= constraint.

Component details

Input ports
  1. Type: Table
    Variables
    A table that requires the following input columns: "Variable Name" (string): the name of the variable when referenced in constraints. "Objective Function Weight" (double): the weight of this variable in the objective function that will be minimized. "Lower Bound" (double): the lower bound (or missing) for each variable. "Upper Bound" (double): the upper bound (or missing) for each variable. "Integer" (boolean): whether this variable must take on an integral value in the final solution.
  2. Type: Table
    Constraints
    The constraint table of upper bounds or equality constraints requires the following input columns: one column for each input variable, where the column name matches the variable name. This column contains the coefficient for this variable in each constraint. "Constraint" (double): the bound of the constraint. "Equals?" (boolean): whether this constraint requires to be met exactly (equals=True) or whether it defines an upper bound.
Output ports
  1. Type: Table
    Variables
    The input variables table with a new "Value" column appended that contains the value this variable takes on in the optimal solution.
  2. Type: Table
    Constraints
    The input constraints table with an additional "Slack" column that indicates how far the optimal value is away from the plane defined by each constraint.

Used extensions & nodes

Created with KNIME Analytics Platform version 5.3.0
  • Go to item
    KNIME Python IntegrationTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.3.0

    knime

This component does not have nodes, extensions, nested components and related workflows

Legal

By using or downloading the component, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits