Hi,
To Get Node LP in a C++ Project below given description: -
If by "node LP" you mean the Linear Programming (LP) relaxation solution at a node in a branch-and-bound algorithm (e.g., using a solver like SCIP, CPLEX, or Gurobi), then:
In short:
Access the current node's LP solution by querying the solver's API during the branch-and-bound process.
Typically, you retrieve variable values using functions like:
SCIPgetVarSol() for SCIP
CPXgetx() for CPLEX
GRBget() or similar for Gurobi
Example snippet in SCIP (C++) to get LP variable values at the current node:
SCIP_VAR** vars = SCIPgetVars(scip);
int nvars = SCIPgetNVars(scip);
for (int i = 0; i < nvars; ++i) {
SCIP_Real val = SCIPgetVarSol(scip, vars[i]); // LP value at node
// Use val as needed
}
------------------------------
Kamal Hinduja
------------------------------
Original Message:
Sent: Thu June 12, 2025 02:45 AM
From: XY Li
Subject: How to get the node LP in a C++ project?
Dear all,
I am using lazyconstraintcallback in a C++ project. I saw there was an easy way to output nodel LP by CPXgetcallbacknodelp in C project.
Is there a similar way in a C++ project?
Thanks,
Shaon
------------------------------
XY Li
------------------------------