Docs
Tutorials
How-to guides
Reference
Explanation
Release notes
Search
Docs
/

Data - Solve

Type identifier: data:solve Category: Data Operations

Description

Finds an optimal solution to a linear or mixed-integer linear model written in CPLEX LP format. Models describe an objective, constraints, bounds, and optional integer or binary variables; they are not executable JavaScript.

This node requires v2 Flow execution. If it is not available in the node selector, contact your administrator.

Input Handles

Handle

Label

Data Type

Required

Description

trigger

Trigger

Control

Yes

Starts the solve when the connected control branch runs. Exactly one incoming connection is supported

script

Model (LP)

string

Yes

CPLEX LP-format model text with a declared Minimize or Maximize objective

Requesting a result through a data connection does not start a solve ahead of its Trigger branch. Blank input, non-string values, and unrecognized model text report invalid_model. Quadratic objectives report unsupported_model.

Output Handles

Handle

Label

Data Type

Description

success

Success

Control

Runs after an optimal or empty-model result is available

error

Error

Typed error control

Reports a failed solve; connect to Control - Switch in Error mode to branch on its code

result

Result

Object

Available only on success; fields are described below

statistics

Statistics

Object

Available only on success; fields are described below

Result

Every property is present; unavailable values are null, not omitted.

Field

Type

Description

status

"optimal" or "empty"

Optimality was established, or the declared model was empty

objectiveValue

number or null

Finite objective value

variables

{ name: string, value: number }[] or null

Named variables with finite solution values

An optimal result always includes an objective value and variable values. An empty result includes both if a valid solution is available, otherwise both are null. Infeasible, unbounded, and time-limited solves are errors, not result statuses. A time-limited solve does not return an incumbent solution.

Statistics

Field

Type

Description

solverTime

Duration or null

Solver runtime as an ISO 8601 duration, for example PT0.00125S for 1.25 milliseconds; not CPU time or total waiting/processing time

variableCount

Integer or null

Original model variable count

constraintCount

Integer or null

Original model constraint count

nonzeroCoefficientCount

Integer or null

Original constraint-matrix nonzero coefficient count

integerVariableCount

Integer or null

Integer-variable count, including semi-integer and implicit-integer variables

simplexIterations

Integer or null

Simplex iteration count

interiorPointIterations

Integer or null

Interior-point iteration count

mipNodeCount

string or null

Exact nonnegative decimal MIP node count, preserving large integer values

mipRelativeGap

number or null

Final relative MIP gap as a fraction

mipDualBound

number or null

Final MIP dual bound

Unavailable or inapplicable measurements are null. Counts are nonnegative. Measured zero remains 0 (or "0" for MIP nodes); zero runtime is PT0S. MIP-only statistics are null for continuous models.

Configuration Options

Property

Studio label

Values

Default

Description

label

Node label

String

"Data - Solve"

Display label

options.presolve

Presolve

"choose", "on", "off"

"choose"

Automatic, enabled, or disabled presolve

options.mipRelativeGap

Relative MIP gap

Finite nonnegative number

0.0001

Fractional gap tolerance; 0.0001 means 0.01%

options.mipAbsoluteGap

Absolute MIP gap

Finite nonnegative number

0.000001

Gap tolerance in objective units

Gap settings affect MIP models only. Neither gap has an application-defined upper bound. There is no adjustable time-limit setting.

Behaviour

Limits

The solver has a fixed five-second time limit. This is not a five-second end-to-end deadline: waiting, model processing, and result preparation may add latency. A separate 30-second processing limit reports solver_error if reached, not time_limit; waiting before processing does not consume it.

Error Handling

No result or statistics output is published on error. An unconnected or unhandled Error route fails the run.

Code

Meaning

Error data

invalid_model

Input is not a valid declared LP model

line: 1-based parser line or null; detail: explanation

unsupported_model

Model uses an unsupported feature, including a quadratic objective

feature: feature description

infeasible

Constraints cannot all be satisfied

No additional data

unbounded

Objective can improve without bound

No additional data

infeasible_or_unbounded

Solver could not distinguish these outcomes

No additional data

solver_error

Solver or processing failed

solverStatus: status or null

time_limit

Solver reached its native time limit

solverTime: duration or null

Example

This model maximizes profit from whole numbers of chairs and tables:

Maximize
 profit: 30 chairs + 50 tables
Subject To
 carpentry: chairs + 2 tables <= 40
 finishing: 2 chairs + tables <= 50
Bounds
 chairs >= 0
 tables >= 0
Generals
 chairs tables
End

With the default options, the Result is:

{
  "status": "optimal",
  "objectiveValue": 1100,
  "variables": [
    { "name": "chairs", "value": 20 },
    { "name": "tables", "value": 10 }
  ]
}

Related pages

Page not found. It may have moved or may not be published.
Browse documentation